Duplicate child rows in Master detail tables

Duplicate child rows in Master detail tables

mm789000mm789000 Posts: 7Questions: 1Answers: 0

Hi,

I have a master detail datatable : for example 1 table category and 1 table sub-category.

When i duplicate a category, i want also duplicate all child rows ( sub-category ).

Is it possible to do that ?

Regards

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Answers

  • colincolin Posts: 12,939Questions: 0Answers: 2,204

    Is that using a join, like this example? Are you able to link to your page so we can see the relationships?

    Colin

  • mm789000mm789000 Posts: 7Questions: 1Answers: 0

    Hi,

    i use this example :
    https://editor.datatables.net/examples/advanced/parentChild.html

    So i need to add a buton on the city table to duplicate the row with all child row from user table.

    Regards

  • mm789000mm789000 Posts: 7Questions: 1Answers: 0

    Hi,

    i use this example to duplicate the master row :
    https://editor.datatables.net/examples/api/duplicateButton.html

    But how to duplicate also child row ?
    Regards

  • allanallan Posts: 54,909Questions: 1Answers: 8,606 Site admin

    But how to duplicate also child row ?

    Editor itself won't do that do you I'm afraid, and as you are seeing our example doesn't attempt to do that.

    What I think your best option for this would be is to send an Ajax request to the server to duplicate a specific row in the parent table, and it would query the linked table to see if there are any other records to duplicate. i.e. basically bypass Editor for what you are looking to do here - I think it would just slow things down in this case.

    Allan

Sign In or Register to comment.