datatable server side with deferloader and data ini
datatable server side with deferloader and data ini
![marcpirat](https://secure.gravatar.com/avatar/a935299844c31ef1eb01a4e7e028bb2e/?default=https%3A%2F%2Fvanillicon.com%2Fa935299844c31ef1eb01a4e7e028bb2e_200.png&rating=g&size=120)
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