How to send all elements in DataTable to Server?

How to send all elements in DataTable to Server?

whitewizardwhitewizard Posts: 12Questions: 0Answers: 0
edited August 2010 in General
I want to get all elements in my DataTable in json format and sent it to server when form submit.
I try this code..

$("#myForm").submit(function(){
var abc = "Haha";
var def = "Yoyo";
$.ajax({
type: "POST",
url: "./myAction.do?cmd=updateDB",
data: "abc="+ abc +"&def="+ def,
success: function(){
alert("Done");
}
});
return false;
});

Follow above code. It send some queryString to server that it's work, but i want to sent json (include all elements of datatable) to server and i want to know if i can send json to server then how server-side get the data. What should i do? please show example code. thanks.

Sorry for my english skill.

Replies

  • whitewizardwhitewizard Posts: 12Questions: 0Answers: 0
    Someone. please help me.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    If I understand correctly, you need to get the nodes which are hidden by DataTables, and build up the query string before sending them to the server. This plug-in will get the hidden nodes: http://datatables.net/plug-ins/api#fnGetHiddenNodes . Then a few lines of jQuery will get the elements and build up the string needed.

    Allan
This discussion has been closed.