Send entire data table to server

Send entire data table to server

smunrosmunro Posts: 2Questions: 1Answers: 0

Hello,

I suspect this question has been put forward before, but for all the searching I've done. I've not really found a concrete example for what I'm looking for. It's very simple, I have a form containing a data table that uses datatable rowReorder. When a user re-orders rows, I have a button which I would like to take the updated table order and post it to the server (an asp.net mvc app). I'm guessing a json string is the way to go for serialization, but I just can't find any good examples on the exact code for extracting the data. For this table, it's all client side, so no server processing.

I have tried datatableInstance.data(), but when using that in an alert, I don't seem to see the data I'm looking for, so I'm assuming that is incorrect.

Any guidance on how to achieve the above would be appreciated.

Stephen

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,853Questions: 1Answers: 10,134 Site admin
    Answer ✓

    Try datatableInstance.rows( { order: 'current' } ).data().toArray();. Does that contain what you are looking for?

    Allan

  • smunrosmunro Posts: 2Questions: 1Answers: 0

    Perfect, thanks for the quick reply! I've got the data required now :smiley:

This discussion has been closed.