From ac5b2c699d1dc0aef17027591850a4ce32a807d6 Mon Sep 17 00:00:00 2001 From: Burhan Ibrahimi Date: Tue, 27 Nov 2018 22:56:39 +0100 Subject: [PATCH] Fix in version 2.1 basic app --- MultiSelect.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MultiSelect.php b/MultiSelect.php index 5242660..058eaef 100755 --- a/MultiSelect.php +++ b/MultiSelect.php @@ -1,8 +1,8 @@ options['id'] = $this->id; } if ($this->selectAll) - echo Html::a(\Yii::t('backend', 'select all'), '#', ['id' => $this->id . '-select-all']); + echo Html::a(\Yii::t('app', 'select all'), '#', ['id' => $this->id . '-select-all']); if ($this->deselectAll) - echo Html::a(\Yii::t('backend', 'deselect all'), '#', ['id' => $this->id . '-deselect-all']); + echo Html::a(\Yii::t('app', 'deselect all'), '#', ['id' => $this->id . '-deselect-all']); MultiSelectAsset::register($this->getView()); + if (isset($this->model)) { $this->pluginOptions[] = $this->model->{$this->attribute}; echo Html::activeDropDownList($this->model, $this->attribute, $this->data, $this->options); @@ -58,7 +59,7 @@ public function registerJsScript() });"; \Yii::$app->view->registerJs(" - $('#" . $this->id . "').multiSelect({$pluginOptions}); + $('#" . $this->id . "').multiSelect({$pluginOptions}); " . $addJsScript, View::POS_END); } -} \ No newline at end of file +}