Closed Andrewkha closed 7 years ago
It obviously will not work... because for the rendered Select2 and form you are repeating the same HTML id
attribute in every table row in the GridView... you need to ensure that you have an unique identifier for all HTML elements in every row.
Use the Closure method to append rowIndex or append an unique model key for every HTML element to generate an unique id.
Thanks! I overrided id for every input element 'options' => ['id' => 'tournament-status' . '-' . $model->id] BTW, all the forms have unique IDs
Hi
I noticed a stange behavior of kartik widgets with Modal. I have a GridView and one of the columns is a link to Modal window with form to edit the model. So here' s the code from the GridView column configuration:
The _form.php file is very simple:
And the strange behavior is that Select widget is rendered for the first GridView row only. For others it's not rendered.
The first snip is a Modal I get when clicking the first item of the GridView, the second - second GridView item. What is more strange - if I replace Select2 widget to render the input field with native yii2 DropDown, everything is OK, all the Modal windows are rendered with no issues