Jogger
(Michele Cocu)
1
Hi,
The following code doesn’t work.
<?= $form->field($modelUserCountry, 'id')->dropDownList(
ArrayHelper::map(Country::find()->all(), 'id', 'code'), ['multiple' => true, 'options' => ['1' => ['selected' => true], '2' => ['selected' => true]]]
) ?>
The content of ArrayHelper::map(Country::find()->all(), ‘id’, ‘code’) is:
Array ( [1] => fd [2] => aa )
The saving with viaTable() an link() works fine, but not the displaying of the selected options after saving.
Can anybody help me? Thanks a lot.
Alex
sukunj
(Mendparasukunj27)
2
Hello jogger,
I think the code should be something like this :
<?= $form->field($modelUserCountry, ‘id’)->dropDownList(
ArrayHelper::map(Country::find()->all(), 'id', 'code'), ['multiple' => true, 'selected'=>'selected']
) ?>
thanks
Jogger
(Michele Cocu)
3
Hi,
It doesn’t work.
What should I do, that in a multiple drop-down list the stored values are selected?
Alex
Jogger
(Michele Cocu)
4
Hi,
Nobody an idea?
I’m using ActiveForm with an multiple dropDownList().
Saving works, but after saving the saved entries are not selected.
Alex