datatable server side with deferloader and data ini
datatable server side with deferloader and data ini
marcpirat
Posts: 51Questions: 18Answers: 0
I try to use datatable with server side option, but i init table with some value;
Js part
var url = 'http://www.json-generator.com/api/json/get/bXZCNjxHCa?indent=4';
var table = $('#example').DataTable({
'processing': true,
'serverSide': true,
"deferLoading": 50,
'ajax': {
'url': url
}
});
Gone an example here
jsfiddle.net/0hczmLxb/
Actually my init data is displayed but when i try to go on next page, I see processing who is displayed... but new data is never displayed.
This discussion has been closed.
Answers
Hi @marcpirat ,
The problem is that the JSON returned isn't quite right - you're always returning this:
The first page loads only because you had
deferLoading
enabled, so it gets what's in the table. Disabling that, and adding that 40 record page length, now loads the data - see here.Cheers,
Colin
I search a way to init my table with some data (generated with thymeleaf) and when client click next page to do a call to the server...
don't know if it's possible