Bulk Row Creation/Duplication
Bulk Row Creation/Duplication
Hello. I want to enable the user to create/duplicate many copies of a single record. I've tried to create a "quantity" field in the Editor that hooks to the create() function to create X copies of a new record. I've also tried to use the duplicate button to create X copies of an existing record. Without success I tried using the preCreate event to pick up a quantity and insert extra records.
My question is similar to this discussion but I'm missing something and can't get it working.
Thanks,
George
Replies
Hi George,
For the duplicate case, you should be able to use:
where the
2
will create 2 records. Change as required.Regards,
Allan
Could the user decide how many copies to create?
Thanks,
George
You'd need an input element somewhere on the page where they can type that in, or perhaps a
select
where they could select the value and then use that value in yourcreate()
call.Potentially you could use a different Editor instance to get that value. Have a single field form that will get a value from them and then the action for the button would be to call
create()
on the "real" Editor instance.Allan