server side paging problem
server side paging problem
Hi all,
I've been playing around with the plug-in and it looks awesome. I'm having an issue using server side processing (v1.6) where I get an error when selecting the last page. For example, if I'm displaying 10 rows and the last page only has 5 items it causes the javascript error: "'length' is null or not an object jquery.datatables.min.js Line: 207". In the query string sent to the server iDisplayLength is 10 when it seems like it should be 5 in this case. Since there are not 10 more items to return the json data only has 5 rows of data. If I have 30 total items in the data the next/last buttons work. A total number that is not evenly divisible by the iDisplayLength size setting causes the exception.
I searched the forum and didn't come across anything similar. Any suggestions?
Thanks,
Jim
I've been playing around with the plug-in and it looks awesome. I'm having an issue using server side processing (v1.6) where I get an error when selecting the last page. For example, if I'm displaying 10 rows and the last page only has 5 items it causes the javascript error: "'length' is null or not an object jquery.datatables.min.js Line: 207". In the query string sent to the server iDisplayLength is 10 when it seems like it should be 5 in this case. Since there are not 10 more items to return the json data only has 5 rows of data. If I have 30 total items in the data the next/last buttons work. A total number that is not evenly divisible by the iDisplayLength size setting causes the exception.
I searched the forum and didn't come across anything similar. Any suggestions?
Thanks,
Jim
This discussion has been closed.
Replies
Regards,
Allan
Thanks for your response. As it turns out I should have also checked the json generated in the border case It turned out that the code on the server placed an extra comma after the last item when the number of items was less than the number to display. Now on to styling issues using jquery ui themes. Sorry to have wasted your time.
Regards,
Jim
Allan