Editor Copy row, ckeditor
Editor Copy row, ckeditor
I've created a button for duplicating row, everything works except the ckeditor type field.
Any thought why that is?
Also, how can I manipulate the data before, and fire functions after, a row is copied?
Using the regular pre/postSubmit functions?
If thats the case, I somehow need to know that it was a 'copy' and not a 'create' or 'edit' action
This question has an accepted answers - jump to answer
Answers
This example here should help with the data manipulation - if the value of 'Office' is changed during the duplication, it updates the original with the new value too. You can use that as a template for the other changes.
I'm not why the ckeditor type doesn't duplicate. Could you update my test case above to reflect that, please, or link to your page so we can see the issue,
Colin
Thanks, your solution seems to work, altough I had to set dupId = undefined on all create / edit actions except the copy action. For example if users clicks copy row button but cancels or closes that modal, the dupId will still be set.
Regarding CKEditor, not sure why but I got errors from CKEditor when copying row,
Probably trying to attach multiple times.
I fixed it by, on duplicate action, delete possible ckeditor instances and then copy the value from the row being copied into the new row
I should say Im using "onPageDisplay" editor, might be a possible reason