瀏覽代碼

修复Form::tree无法保存数据问题

jqh 4 年之前
父節點
當前提交
76bbdf8978

+ 4 - 4
resources/assets/dcat/js/Dcat.js

@@ -108,7 +108,6 @@ export default class Dcat {
         let self = this,
             clear = function () {
                 if (initialized[selector]) {
-                    initialized[selector].takeRecords();
                     initialized[selector].disconnect();
                 }
             };
@@ -119,20 +118,21 @@ export default class Dcat {
         clear();
 
         initialized[selector] = $.initialize(selector, function () {
-            var $this = $(this);
+            let $this = $(this),
+                id = $this.attr('id');
+
             if ($this.attr('initialized')) {
                 return;
             }
             $this.attr('initialized', '1');
 
             // 如果没有ID,则自动生成
-            var id = $this.attr('id');
             if (! id) {
                 id = "_"+self.helpers.random();
                 $this.attr('id', id);
             }
 
-            callback.call(this, $(this), id)
+            callback.call(this, $this, id)
         }, options);
     }
 

文件差異過大導致無法顯示
+ 0 - 0
resources/dist/dcat/js/dcat-app.js


文件差異過大導致無法顯示
+ 0 - 0
resources/dist/dcat/js/dcat-app.js.map


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

@@ -7,7 +7,7 @@
         @include('admin::form.error')
 
         <div class="input-group" style="width:100%">
-            <input {{$disabled}} {!! $attributes !!} class="hidden-input" name="{{$name}}" />
+            <input {{$disabled}} type="hidden" class="hidden-input" name="{{$name}}" />
 
             <div class="jstree-wrapper">
                 <div class="d-flex">

+ 1 - 1
resources/views/scripts/select.blade.php

@@ -97,4 +97,4 @@
         }
     </script>
 @endif
-@endsection
+@overwrite

+ 0 - 2
src/Form/Field/Tree.php

@@ -223,8 +223,6 @@ class Tree extends Field
 
     public function render()
     {
-        $this->attribute('type', 'hidden');
-
         $checkboxes = new WidgetCheckbox();
 
         $checkboxes->style('primary');

部分文件因文件數量過多而無法顯示