Commit 7dbbfcac87b5b82142771a86c8b89faa5aa5dc0f

Authored by Anastasia
1 parent 420d8fd5

all select

Showing 1 changed file with 32 additions and 18 deletions   Show diff stats
views/blog-article/_form.php
@@ -52,10 +52,15 @@ @@ -52,10 +52,15 @@
52 'options' => [ 52 'options' => [
53 'placeholder' => \Yii::t('blog', 'Search for a categories ...'), 53 'placeholder' => \Yii::t('blog', 'Search for a categories ...'),
54 'multiple' => true, 54 'multiple' => true,
  55 +
  56 + ],
  57 +
  58 + 'value' => array_keys($model->categoryIds),
  59 + 'data' => $model->categoryIds,
  60 + 'toggleAllSettings' => [
  61 + 'selectLabel' => false,
55 ], 62 ],
56 - 'value' => array_keys($model->categoryIds),  
57 - 'data' => $model->categoryIds,  
58 - 'pluginOptions' => [ 63 + 'pluginOptions' => [
59 'allowClear' => true, 64 'allowClear' => true,
60 'minimumInputLength' => 3, 65 'minimumInputLength' => 3,
61 'language' => [ 66 'language' => [
@@ -100,14 +105,17 @@ @@ -100,14 +105,17 @@
100 <?php 105 <?php
101 echo Select2::widget( 106 echo Select2::widget(
102 [ 107 [
103 - 'name' => 'tagIds',  
104 - 'options' => [ 108 + 'name' => 'tagIds',
  109 + 'options' => [
105 'placeholder' => \Yii::t('blog', 'Search for a tags ...'), 110 'placeholder' => \Yii::t('blog', 'Search for a tags ...'),
106 'multiple' => true, 111 'multiple' => true,
107 ], 112 ],
108 - 'value' => array_keys($model->tagIds),  
109 - 'data' => $model->tagIds,  
110 - 'pluginOptions' => [ 113 + 'toggleAllSettings' => [
  114 + 'selectLabel' => false,
  115 + ],
  116 + 'value' => array_keys($model->tagIds),
  117 + 'data' => $model->tagIds,
  118 + 'pluginOptions' => [
111 'allowClear' => true, 119 'allowClear' => true,
112 'minimumInputLength' => 3, 120 'minimumInputLength' => 3,
113 'language' => [ 121 'language' => [
@@ -170,14 +178,17 @@ @@ -170,14 +178,17 @@
170 } 178 }
171 echo Select2::widget( 179 echo Select2::widget(
172 [ 180 [
173 - 'name' => 'articleIds',  
174 - 'options' => [ 181 + 'name' => 'articleIds',
  182 + 'options' => [
175 'placeholder' => \Yii::t('blog', 'Search for an articles ...'), 183 'placeholder' => \Yii::t('blog', 'Search for an articles ...'),
176 'multiple' => true, 184 'multiple' => true,
177 ], 185 ],
178 - 'value' => array_keys($model->articleIds),  
179 - 'data' => $model->articleIds,  
180 - 'pluginOptions' => [ 186 + 'toggleAllSettings' => [
  187 + 'selectLabel' => false,
  188 + ],
  189 + 'value' => array_keys($model->articleIds),
  190 + 'data' => $model->articleIds,
  191 + 'pluginOptions' => [
181 'allowClear' => true, 192 'allowClear' => true,
182 'minimumInputLength' => 3, 193 'minimumInputLength' => 3,
183 'language' => [ 194 'language' => [
@@ -224,14 +235,17 @@ @@ -224,14 +235,17 @@
224 <?php 235 <?php
225 echo Select2::widget( 236 echo Select2::widget(
226 [ 237 [
227 - 'name' => 'productIds',  
228 - 'options' => [ 238 + 'name' => 'productIds',
  239 + 'options' => [
229 'placeholder' => \Yii::t('blog', 'Search for products ...'), 240 'placeholder' => \Yii::t('blog', 'Search for products ...'),
230 'multiple' => true, 241 'multiple' => true,
231 ], 242 ],
232 - 'value' => array_keys($model->productIds),  
233 - 'data' => $model->productIds,  
234 - 'pluginOptions' => [ 243 + 'toggleAllSettings' => [
  244 + 'selectLabel' => false,
  245 + ],
  246 + 'value' => array_keys($model->productIds),
  247 + 'data' => $model->productIds,
  248 + 'pluginOptions' => [
235 'allowClear' => true, 249 'allowClear' => true,
236 'minimumInputLength' => 3, 250 'minimumInputLength' => 3,
237 'language' => [ 251 'language' => [