Collect data from the table and send to the Node.js

Collect data from the table and send to the Node.js

larrybglarrybg Posts: 14Questions: 5Answers: 0
edited March 2018 in Free community support

Hello! I'm new to this, please don't judge me too harshly. I've added the first column to the table as a checkbox, and Submit button under the table. I need a way to collect all data in the rows with the selected checkboxes and send it (POST) to the Node.js server as JSON. Can you help?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    I would suggest using the Select extension then you can do:

    table.rows( { selected: true } ).data().toArray()
    

    If you can't use Select, then use rows().every() to loop over the rows and get the data for each one which has a checked checkbox (row().data()).

    Allan

This discussion has been closed.