Open Lucianoj opened 7 years ago
i'm also facing the same problem???anybody has its solution.
Hello friends i have found a solution for this i have added only one line in the model.php(vendor\yiisoft\yii2\base\model.php) in this function public static function loadMultiple($models, $data, $formName = null){ if(isset($data['MeetingDescription'])){ //check if array is not empty $data['MeetingDescription']=array_merge($data['MeetingDescription']);//it should put on just after the starting the function }
MeetingDescription is my subarray or sub table(which are dynamic)
Note:- This is not perfect solution but your work will not stop whenever your yii directory will update then your code will flush after update plz update this file also.
Using dynamicform in a modal, when add a new item in update action, the index of array content on $data array (array of arrays) start in 1 but not in 0. example:
it must be:
because $models starts with 0 index in
all of this, in vendor/yiisoft/yii2/base/Model.php loadMultiple function.
When use dynamic form but not in modal, it works fine.
_form.php (used in a modal)
The update function in the controller:
And the loadMultiple function in base/Model.php