File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -353,6 +353,7 @@ protected function prepareJsAttributes()
353
353
$ attributes = [];
354
354
foreach ($ this ->columns as $ column ) {
355
355
$ model = $ column ->getModel ();
356
+ $ inputID = str_replace (['-0 ' , '-0- ' ], '' , $ column ->getElementId (0 ));
356
357
if ($ this ->form instanceof ActiveForm && $ model instanceof Model) {
357
358
$ field = $ this ->form ->field ($ model , $ column ->name );
358
359
foreach ($ column ->attributeOptions as $ name => $ value ) {
@@ -362,12 +363,14 @@ protected function prepareJsAttributes()
362
363
}
363
364
$ field ->render ('' );
364
365
$ attributeOptions = array_pop ($ this ->form ->attributes );
365
- $ attributeOptions = ArrayHelper::merge ($ attributeOptions , $ column ->attributeOptions );
366
+ if (isset ($ attributeOptions ['name ' ]) && $ attributeOptions ['name ' ] === $ column ->name ) {
367
+ $ attributes [$ inputID ] = ArrayHelper::merge ($ attributeOptions , $ column ->attributeOptions );
368
+ } else {
369
+ array_push ($ this ->form ->attributes , $ attributeOptions );
370
+ }
366
371
} else {
367
- $ attributeOptions = $ column ->attributeOptions ;
372
+ $ attributes [ $ inputID ] = $ column ->attributeOptions ;
368
373
}
369
- $ inputID = str_replace (['-0 ' , '-0- ' ], '' , $ column ->getElementId (0 ));
370
- $ attributes [$ inputID ] = $ attributeOptions ;
371
374
}
372
375
373
376
return $ attributes ;
You can’t perform that action at this time.
0 commit comments