Buy editor

Buy editor

Mike-motiv8Mike-motiv8 Posts: 30Questions: 5Answers: 0

I'm thinking of buying editor

But would it also be possible to place a link at the end of each row, that when pressed will copy the row data, then insert it in to another table.
Are there any examples, where I can get started?

This question has accepted answers - jump to:

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Hi @Mike-motiv8 ,

    Yep, that'll be easy to do - even without Editor. I don't have an exact example, but this here is transferring rows between tables based on the search results, and this here shows how to add a button to a column.

    Cheers,

    Colin

  • Mike-motiv8Mike-motiv8 Posts: 30Questions: 5Answers: 0

    Thank you colin.

    I will still buying Editor, as I need the functionallity.

  • Mike-motiv8Mike-motiv8 Posts: 30Questions: 5Answers: 0

    It was the second example i needed.

    Is there a api or similar i could use to copy selected rows to another database table

  • kthorngrenkthorngren Posts: 21,310Questions: 26Answers: 4,948

    The button example can be updated to use row.add() to add the clicked row to the another Datatable. Here is an example:
    http://live.datatables.net/weyodufi/1/edit

    The example assumes the data structure of the two tables is the same. If not then the source data would need to be changed to match the destination Datatable structure.

    Kevin

  • Mike-motiv8Mike-motiv8 Posts: 30Questions: 5Answers: 0

    Thank You kthorngren
    I had seen this.
    The example you have shown, adds the data to another Datatable.

    What i'm looking for is to add the selected row to a second table within my database.

    I have two Identical tables within my database. One called myMusic and the other called guestsMusic. I'm trying to copy/paste the selected row to the guestsMusic table within my database.

  • kthorngrenkthorngren Posts: 21,310Questions: 26Answers: 4,948
    edited March 2019 Answer ✓

    What i'm looking for is to add the selected row to a second table within my database.

    Sounds like you need to use jQuery Ajax to send the selected rows to the server which will then insert them into the other table. The data parameter is what you would use to send the data from the selected rows. This functionality is outside the scope of the Datatables application.

    Kevin

This discussion has been closed.