Converting datatable to json issue

Converting datatable to json issue

BekariBekari Posts: 9Questions: 5Answers: 0

I am using 'HTML (DOM) sourced data' with 'pagination'. That works fine!!!
Now i want to let the user to bring some changes to the table and then post those changes to the server as json.
I am trying to select the all rows from datatable first:
function postData() {
var data = new Array();
$("#datatable").find("tr:gt(0)").each(function () {
var number = $(this).find("td:eq(0)").text();
var barcodes = $(this).find("#barcodes").val();
var remarks = $(this).find("#remarks").val();
alert(number + " " + barcodes + " " + remarks);
});
}

The problem is, that the code above selects only the data from the 'first page', then it stops.
How can i select the data from entire table?

Thanks in advance.

This question has an accepted answers - jump to answer

Answers

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

    You would use rows().data() to get the data. It would be worth looking at Editor as that's designed for this kind of operation,

    Colin

This discussion has been closed.