use of https://editor.datatables.net/examples/api/duplicateButton.html but need to clear IdSrc field
use of https://editor.datatables.net/examples/api/duplicateButton.html but need to clear IdSrc field
I want to make a copy of a row in the table, actually will be doing additional copying of database records on the server behind the scenes when the copied row is submitted.
I see https://editor.datatables.net/examples/api/duplicateButton.html which is just what I'm looking for. One problem is that the rowid (IdSrc field) is the same as the selected row. This causes a problem because I have dependent() fields which should be updated as if this were a create, not an edit (I use defaults for create and use the current values for edit, and I have been using rowid to determine if it is create or edit in the dependent ajax api).
Is there any way to reset the rows[0][rowid] value (e.g., to 0 or null) which will be used in the dependent ajax call when using the duplicateButton pattern?
Answers
I guess I found a workaround, or maybe this is just a different solution to the duplicate problem: