wbraganca / yii2-dynamicform

It is widget to yii2 framework to clone form elements in a nested manner, maintaining accessibility.
Other
436 stars 438 forks source link

The models desappear when "enableClientValidation" to false #23

Closed timmy78 closed 9 years ago

timmy78 commented 9 years ago

In the ActiveForm config, if I put enableClientValidation to false, and then there are errors in the models, the models don't appear in the form.

I have the same problem in the create scenario : if before I declare some models with attributes, they don't appear in the form.

How to make it work like in the update scenario ?


More informations : it's the javascript of the widget which delete the items. If I don't use the widget it appears.


Thank you

wbraganca commented 9 years ago

Which version of yii2 are you using?

timmy78 commented 9 years ago

The last one I suppose : "yiisoft/yii2": "*",

wbraganca commented 9 years ago

I did not find any problem. Put here the code of your view.

dynamicform-issue-23

timmy78 commented 9 years ago

Did you tried in the actionCreate :

$modelsAddress = [
  new Address([
    'full_name' => 'test'
  ]),
  new Address([
    'full_name' => 'test2'
  ]),
];

I don't understand why the javascript remove my DOM models in the view ??!!

Since the big update the first child doesn't appear anymore in the create action.

timmy78 commented 9 years ago

I figured out ! That was because I put 'min' => 0 instead of 1 It removed all my items (at line 187 in DynamicFormWidget)