pagination doing serverside processing (differently)
pagination doing serverside processing (differently)
Hello All,
Had another question today. For reporting purposes we are trying to get get data from server per page..... Nothing different from what has been suggested in server side processing examples.
The problem arises when on server we are not able to send total number the number of records (recordsTotal) which will be fetched as a part of query. Please note this is deliberate on server as we do not want to run a query to fetch count of all records and then send it as well.
Due to above logic on server we always end up on client having only one page + next and previous buttons disabled.
Is there a way to enable previous and next buttons always?
-Gunjan
Answers
You could just hard code a number that will always be equal to or higher than your real total. People can just keep hitting next and eventually they will just go into blank pages of the table with zero data.
thanks for the response, this should work if I am able to know the next or previous page number. do you think I can call DT pageinfo api and it will give me the page number?
Looks like you can get the current page this way: http://datatables.net/reference/api/page.info
cool. Also can you please tell me how to hardcode records total upfront.
Using the
pageLength
option.The full, searchable, reference is available here for the options, API, etc: http://datatables.net/reference/
Allan