Converting datatable to json issue
Converting datatable to json issue
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
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