serverside processing, strange behavior of iDisplayLength, pagination.
serverside processing, strange behavior of iDisplayLength, pagination.
I have been trying to resolve this issue / bug for sometime now but its taking too long so I thought I would ask here.
I am using server side processing and the issue is as follow.
I get the first draw, lets say total 600 records. My iDisplayLength in the view is set to 50. So it creates pagination just fine. Page one shows
01 to 50 of 600. Which is perfect. But when I go to / click on page 2, it shows 51 to 600 of 600. Page 3 shows 101 to 600 of 600 and so on.
Now if I on left bottom use the dropdown and change the value of display to anything else thats currently showing, this bug goes away.
So if the dropdown had 50, and I change it to 10, the table gets regenerated and it work.
What can I do to solve it. I tried to dynamically use this oTable.fnSetDisplayLength = 50; after regenenrating the table, but no use. I also recreated the whole table like oTable.fnDraw(true); after first initializing it, but still no go. It only works when I change the dropdown value. Can anyone help.
Thanks
I am using server side processing and the issue is as follow.
I get the first draw, lets say total 600 records. My iDisplayLength in the view is set to 50. So it creates pagination just fine. Page one shows
01 to 50 of 600. Which is perfect. But when I go to / click on page 2, it shows 51 to 600 of 600. Page 3 shows 101 to 600 of 600 and so on.
Now if I on left bottom use the dropdown and change the value of display to anything else thats currently showing, this bug goes away.
So if the dropdown had 50, and I change it to 10, the table gets regenerated and it work.
What can I do to solve it. I tried to dynamically use this oTable.fnSetDisplayLength = 50; after regenenrating the table, but no use. I also recreated the whole table like oTable.fnDraw(true); after first initializing it, but still no go. It only works when I change the dropdown value. Can anyone help.
Thanks
This discussion has been closed.
Replies
Please link to a test case.
As a guess I would say you are returning strings rather than ints in the JSON return for DataTables.
Allan
since this is in a framework, I am not sure how to put a test case here. May be I will try to recreate an app with same framework and provide access here. It may take this weekend to do so.
Also since I am using php, not sure how useful would that actually be? If you think it would be helpful to get answer, I will do that this weekend.
thanks for a quick reply
Allan