Editor Copy row, ckeditor

Editor Copy row, ckeditor

TronikTronik Posts: 101Questions: 23Answers: 0

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


  • colincolin Posts: 12,978Questions: 0Answers: 2,209
    Answer ✓

    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,


  • TronikTronik Posts: 101Questions: 23Answers: 0

    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

     action: function ( e, dt, node, config ) {
    var web_description = table.rows( { selected: true } ).data([0].products.web_description
        for(name in CKEDITOR.instances)
    dupId = table.rows( { selected: true } ).data()[0]
          .edit( table.rows( {selected: true} ).indexes(), {
             title: '"Copy row',
             buttons: 'Create'
             } )
            .mode( 'create' )

    I should say Im using "onPageDisplay" editor, might be a possible reason

Sign In or Register to comment.