I have select field looking like that:
<?= $form->field($place, "[{$index}]id")->widget(Select2::classname(), [
'data' => ArrayHelper::map(PresentationPlace::find()->all(), 'id', 'displaynew'),
'class' => 'field',
'options' => ['placeholder' => Yii::t('app', 'Pick place for presentation')],
'pluginOptions' => [
'allowClear' => false
],
])->label(Yii::t('app', Yii::t('app', 'Place'))) ?>
And after that field, I have short form for adding new place - you can fill it and send AJAX request. It adds this place to my database. I would like to have my select options updated, after the AJAX request is complete - that options would be up-to-date after every new place added. How can I achieve that in Yii 2?