jqh 4 năm trước cách đây
mục cha
commit
1477fb64ff

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

@@ -27,7 +27,7 @@
 
     Dcat.grid.SelectTable({
         dialog: replaceNestedFormIndex('#{{ $dialogId }}'),
-        container: replaceNestedFormIndex('#{{ $id }}'),
+        container: replaceNestedFormIndex('#container-{{ $id }}'),
         input: replaceNestedFormIndex('#hidden-{{ $id }}'),
         @if(isset($max))
         multiple: true,

+ 3 - 3
src/Form/Field.php

@@ -1263,16 +1263,16 @@ class Field implements Renderable
 
         $this->callComposing();
 
-        [$html, $script] = Admin::resolveHtml(
+        $result = Admin::resolveHtml(
             view($this->view(), $this->variables()),
             ['runScript' => $this->runScript]
         );
 
-        $this->script .= $script;
+        $this->script .= $result['script'];
 
         $this->withScript();
 
-        return $html;
+        return $result['html'];
     }
 
     public function runScript(bool $value = true)

+ 3 - 3
src/Traits/HasHtml.php

@@ -39,7 +39,7 @@ trait HasHtml
      */
     public static function view(string $view, array $data = [])
     {
-        return static::resolveHtml(view($view, $data))[0];
+        return static::resolveHtml(view($view, $data))['html'];
     }
 
     /**
@@ -49,7 +49,7 @@ trait HasHtml
      *
      * @throws \Throwable
      *
-     * @return array [$html, $script]
+     * @return array ['html' => $html, 'script' => $script]
      */
     public static function resolveHtml($content, array $options = []): array
     {
@@ -70,7 +70,7 @@ trait HasHtml
             $script = '';
         }
 
-        return [$head['html'].$body['html'], $script];
+        return ['html' => $head['html'].$body['html'], 'script' => $script];
     }
 
     /**