DataTables copy selected rows

DataTables copy selected rows

yskapellyskapell Posts: 47Questions: 14Answers: 3

Hello all,

I want to ask if I can copy a selected row (whole row) when I click it in a temp tables in a database or in a javascript array.

I tried to find any example but nothing,

Thank you,

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 20,139Questions: 26Answers: 4,734

    Sorry but I don't understand what you are wanting to do.

    Are you wanting to copy from Datatables or to Datatables?

    If copying from Datatables how are you selecting the rows?

    Some options to copy from Datatables is to use the copyHtml5 button or use row().data() to get the row data.

    You can use row.add() to insert rows into the Datatable that are copied from the database or Javascript array.

    For more specific help please provide more details of how you want this process to work.

    Kevin

  • yskapellyskapell Posts: 47Questions: 14Answers: 3
    edited November 2022

    I want to copy from datatable to a temp array.

    After I have select all the data I need to insert from that array to a database.

    If I am not mistaken the copyHtml5 button copy something to keyboard. right?

  • kthorngrenkthorngren Posts: 20,139Questions: 26Answers: 4,734
    Answer ✓

    After I have select all the data

    Are you using the Select extension? If yes then see this example of getting the selected rows.

    If not then yu might be able to use selector-modifier to select the rows with a class you assign using rows().data().

    If I am not mistaken the copyHtml5 button copy something to keyboard. right?

    Yes, this copies to the clipboard.

    Kevin

  • yskapellyskapell Posts: 47Questions: 14Answers: 3

    Hello.

    The example of select extension is good for me.

    Is any way to play in an editor with the specific example?

  • kthorngrenkthorngren Posts: 20,139Questions: 26Answers: 4,734
    Answer ✓

    You can find some pre-built templates here for DOM, Ajax or Server side processing. Use the Download builder to get all the libraries you are intereted in testing.

    Kevin

Sign In or Register to comment.