Reputation: 33
got some issues in dataTables I hope you can help me. after requesting it renders the table with the correct data but searching, pagination and entry filters are not working plus the whole page is not responding.
code:
function generate (table, action, verb, columns,func) {
var table = $(table).DataTable({
"serverSide": true,
"processing": true,
"ajax": {
"url": action,
"type": "post",
"datatype": "json"
},
"columns": columns
});
Upvotes: 0
Views: 480
Reputation: 33
My problem was I was loading the whole records like around 70 thousand data in the first load of the page in effect Data Table got lag. And I realized that when server side is set to true, searching, paging and filtering are handled on the server side. Data tables is posting some data that are essential in order for it to work properly such as draw, start, length, etc. So in the first load data tables will post start = 0, length depends on the entries needed to display (i.e. 10,25,50,100 records to display) and when i got that information to my back end, I NEED to load 10 or 25 or 50 or 100 records depending on the length that is posted. Hope someone can help this solution
Upvotes: 0