Hello everyone. I am trying to resolve Car Service Items on my project.
So here is what I need:
I have CarService model and CarServiceItems model
I want to have rendered CarServiceItems _form view on CarService _form view
I want to add multiple items, and POST everything (whole CarService and all of CarServiceItems models) that I can handle on controller CarService controller.
I know adding multiple Items should be implemented in Knockout.js, so can please anyone give at lease some example Knockout and Yii togather, not only Knockout examples, I already see them.
The problem of (jquery) widget’s is always the same:
After cloning a element, the jquery plugin has to be executed for cloned element with the new id again.
So the has to be executed extra js-stuff after the ‘newId’ event.
Another developer (see the method comment of MultiModelForm::afterNewIdAutoComplete) did add the support for autocomplete with the js-code in the ‘afterNewIdAutoComplete’ method.
So first try the standard autocomplete widget for the car_part_component_id field.
You have to tell mmf to execute the afterNewIdAutoComplete js-code after cloning.
I didn’t try to add jsAfterNewId, but I don’t see any problem with that, so I think that works. But for my custom autocomplete widget, unfortunately it doesn’t work, and I cannot spend so much time fixing plugin code, so I decide to implement my feature as dropdown list.