Ver Fonte

Merge pull request #631 from xqbumu/patch-1

解决 MultipleSelectTable 中 js 中接收数据类型问题
Jiang Qinghua há 5 anos atrás
pai
commit
064c06e0bb
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      src/Grid/Filter/Presenter/MultipleSelectTable.php

+ 3 - 1
src/Grid/Filter/Presenter/MultipleSelectTable.php

@@ -33,6 +33,8 @@ class MultipleSelectTable extends SelectTable
 
 
     protected function addScript()
     protected function addScript()
     {
     {
+        $options = json_encode($this->options);
+
         Admin::script(
         Admin::script(
             <<<JS
             <<<JS
 {$this->dialog->getScript()}
 {$this->dialog->getScript()}
@@ -43,7 +45,7 @@ Dcat.grid.SelectTable({
     input: '#hidden-{$this->id}',
     input: '#hidden-{$this->id}',
     multiple: true,
     multiple: true,
     max: {$this->max},
     max: {$this->max},
-    values: {$this->options},
+    values: {$options},
 });
 });
 JS
 JS
         );
         );