Просмотр исходного кода

Merge pull request #631 from xqbumu/patch-1

解决 MultipleSelectTable 中 js 中接收数据类型问题
Jiang Qinghua 5 лет назад
Родитель
Сommit
064c06e0bb
1 измененных файлов с 3 добавлено и 1 удалено
  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()
     {
+        $options = json_encode($this->options);
+
         Admin::script(
             <<<JS
 {$this->dialog->getScript()}
@@ -43,7 +45,7 @@ Dcat.grid.SelectTable({
     input: '#hidden-{$this->id}',
     multiple: true,
     max: {$this->max},
-    values: {$this->options},
+    values: {$options},
 });
 JS
         );