JQuery Datatable reload - version 1.10.0
JQuery Datatable reload - version 1.10.0
I'm trying to reload datatable. I click a cell and then an ajax request works. If it returns success, I need to reload the datatable with new data. I can see reload action "Processing" but new data doesn't seen in the table.
I'm using the same function in deleting process and it works.
Here is my code sample;
var dataTableId = "#dataTable";
function deleteFunction(){
// works correctly
}
$(dataTableId).dataTable({
"sAjaxSource": "url",
"aoColumns": [
...
],
"aoColumnDefs": [
...
]
});
var table = $(dataTableId).DataTable();
$('#dataTableFiles tbody').on('click', 'td', function () {
$.ajax({
url: "url",
type: 'post',
dataType: 'json',
data: postArray,
success: function (response) {
if (response.result) {
table.ajax.reload();
}
else {
table.ajax.reload();
}
},
error: function () {
console.log("err")
}
});
});
Thank you..
Answers
Can you link tp the page showing the issue please?
Allan