jqh 5 lat temu
rodzic
commit
6a61c87d77

+ 2 - 2
resources/views/form/tree.blade.php

@@ -11,7 +11,7 @@
 
             <div class="jstree-wrapper {{$class}}-tree-wrapper">
                 {!! $checkboxes !!}
-                <div class="_tree" style="margin-top:10px"></div>
+                <div class="da-tree" style="margin-top:10px"></div>
             </div>
         </div>
 
@@ -25,7 +25,7 @@
 @endphp
 <script data-exec-on-popstate>
 LA.ready(function () {
-    var $tree = $('{!!$formId !!} .{{$class}}-tree-wrapper').find('._tree'),
+    var $tree = $('{!!$formId !!} .{{$class}}-tree-wrapper').find('.da-tree'),
         opts = {!! $options !!},
         $input = $('{!!$formId !!} input[name="{{$name}}"]'),
         parents = {!! $parents !!};

+ 2 - 2
resources/views/widgets/tree.blade.php

@@ -1,8 +1,8 @@
-<div  {!! $attributes !!}><div class="_tree"></div></div>
+<div  {!! $attributes !!}><div class="da-tree"></div></div>
 
 <script>
 LA.ready(function () {
-    var opts = {!! json_encode($options) !!}, tree = $('#{{$id}}').find('._tree');
+    var opts = {!! json_encode($options) !!}, tree = $('#{{$id}}').find('.da-tree');
 
     opts.core.data = {!! json_encode($nodes) !!};
 

+ 1 - 1
src/Form/Field/Tree.php

@@ -116,7 +116,7 @@ class Tree extends Field
      *
      * @return $this
      */
-    public function columnNames(string $idColumn = 'id', string $textColumn = 'name', string $parentColumn = 'parent_id')
+    public function name(string $idColumn = 'id', string $textColumn = 'name', string $parentColumn = 'parent_id')
     {
         $this->columnNames['id'] = $idColumn;
         $this->columnNames['text'] = $textColumn;

+ 3 - 3
src/Grid/Displayers/DialogTree.php

@@ -127,7 +127,7 @@ class DialogTree extends AbstractDisplayer
      *
      * @return $this
      */
-    public function columnNames(string $idColumn = 'id', string $textColumn = 'name', string $parentColumn = 'parent_id')
+    public function name(string $idColumn = 'id', string $textColumn = 'name', string $parentColumn = 'parent_id')
     {
         $this->columnNames['id'] = $idColumn;
         $this->columnNames['text'] = $textColumn;
@@ -176,7 +176,7 @@ EOF;
         Admin::script(
             <<<JS
 $('.{$this->getSelectorPrefix()}-open-tree').off('click').click(function () {
-    var tpl = '<div class="jstree-wrapper" style="border:0"><div class="_tree" style="margin-top:10px"></div></div>', 
+    var tpl = '<div class="jstree-wrapper" style="border:0"><div class="da-tree" style="margin-top:10px"></div></div>', 
         opts = $opts,
         url = '{$this->url}',
         t = $(this),
@@ -215,7 +215,7 @@ $('.{$this->getSelectorPrefix()}-open-tree').off('click').click(function () {
             content: tpl,
             title: '{$title}',
             success: function (a, idx) {
-                var tree = $('#layui-layer'+idx).find('._tree');
+                var tree = $('#layui-layer'+idx).find('.da-tree');
                 
                 tree.on("loaded.jstree", function () {
                     tree.jstree('open_all');

+ 1 - 1
src/Widgets/Tree.php

@@ -74,7 +74,7 @@ class Tree extends Widget
      *
      * @return $this
      */
-    public function columnNames(string $idColumn = 'id', string $textColumn = 'name', string $parentColumn = 'parent_id')
+    public function name(string $idColumn = 'id', string $textColumn = 'name', string $parentColumn = 'parent_id')
     {
         $this->columnNames['id'] = $idColumn;
         $this->columnNames['text'] = $textColumn;