0 always being passed in Start
0 always being passed in Start
mattpm
Posts: 4Questions: 1Answers: 0
Hi,
for some reason, start is always 0 on the server side even though the paginate buttons are available e.g.
<li class="paginate_button "><a href="#" aria-controls="myTable" data-dt-idx="4" tabindex="0">4</a></li>
Any ideas on why the value is not being passed through?
thanks
Matt
This discussion has been closed.
Answers
I've been looking at this for hours. Somewhere along the way, the settings._iDisplayStart is not persisted so by the time the _fnDraw method is entered, the value is 0.
I have an interim "ugly" workaround for the time being where I persist the start value in a module level variable and set oSettings._iDisplayStart to this value but as to why it's losing the value when other values are persisted I'm unsure.
Hi Matt,
I'm not clear on what the problem is, probably me being slow. We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Thanks Colin,
it's frustrating but I cannot reproduce this issue if I work it up from scratch. This issue has emerged in an existing project due to some change I've made somewhere. I've tried tracing through the changes via source control and nothing leaps out.
I've further honed in on the issue that when _fnReDraw is called, holdPosition is false so iDisplayStart is set to 0.
So, now looking at holdPosition to see why it's not being set to true.
Good luck with that, sounds like you're making progress at least...
Cheers,
Colin
Thanks Colin. Sadly, I have to leave it with just hard coded setting holdPosition to true with a comment. I know it's not ideal but that will have to do for now.
What version of DataTables are you using? Can you show us what API calls you are making or any plug-ins that you might have installed?
Allan