How to load recieved json directly to myTable?
How to load recieved json directly to myTable?
Alex_ander
Posts: 11Questions: 4Answers: 0
Hello!
We have the following code to add new row to the table:
$.ajax({
url: "../datasource.php",
type: "POST",
dataType: "html",
data: $('#myForm').serialize(),
success: function(response) {
//var result = $.parseJSON(response);
myTable.ajax.reload();
},
error: function(response) {
console.log(response);
}
});
But our datasource.php returns a full dataset for the table. So we actually not need to reload data, its better to load received json (commented var result) directly to myTable without extra requests to server. How to do it?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Use
row.add()
or for multiple rows userows.add()
.Kevin
Thanks a lot for your kind reply!