I have a nested migx grid. If I wanted to duplicate the record in the parent grid and have it duplicate the child MIGX grid, how to do that?
The nested grid is a migxdb type, not migx JSON string.
- 5,888 Posts
first, you will need to have a way, to check in the update-processor (or in a customized save-function of your object)
if this is a duplication.
This should be simple.
Add a (hidden) field with the id of your source-object to the form
Then, on update, if the object_id is 'new' and the source-object - id is not empty, it seems to be a duplicate.
Now you can duplicate the children with getMany/addMany inside your customized update-processor (or in a customized save-function of your parent-object)
Ahhh, the hidden field is what I was missing as a means to get the source object id.
I'll work on this later today and post the final for others.
- 4 Posts
Hi Jason, is it possible for you to post the customized update-processor (or save-function) you used to accomplish this? OR did you take another route? I am getting stuck on the same problem. Thanks!