Pagination problems when using column filter and iDisplayLength
Pagination problems when using column filter and iDisplayLength
I've made some progress with my table and implemented multi-column filtering which seems to be fine - but my paging seems to have been thrown out of kilter when I add an "iDisplayLength" parameter to the initialisation
I have uploaded my table to the debugger (code: awifum) and can provided other docs if necessary.
Everything seems o.k. without the "iDisplayLength" but when it is included:
a) 'first' and 'last' buttons seem to work ok.
b) when using the full_numbers option if I click '2' for page two the length of display goes from the next row to the end of the data (i.e. instead of "showing 21 to 40 of 1692" it is "showing 21 to 1692 of 1692")
c) similarly, if I am on the last page and click "prev" the start row is reduced by 20 (my page length) but the display shows from there to the end of the table.
d) the 'prev' button gets an error from line 1325 of jquery.dataTables.js that aoData is is undefined: [code] if ( oSettings.aiDisplay.length !== 0 )
{
var iStart = oSettings._iDisplayStart;
var iEnd = oSettings._iDisplayEnd;
if ( oSettings.oFeatures.bServerSide )
{
iStart = 0;
iEnd = oSettings.aoData.length;
}
for ( var j=iStart ; j
I have uploaded my table to the debugger (code: awifum) and can provided other docs if necessary.
Everything seems o.k. without the "iDisplayLength" but when it is included:
a) 'first' and 'last' buttons seem to work ok.
b) when using the full_numbers option if I click '2' for page two the length of display goes from the next row to the end of the data (i.e. instead of "showing 21 to 40 of 1692" it is "showing 21 to 1692 of 1692")
c) similarly, if I am on the last page and click "prev" the start row is reduced by 20 (my page length) but the display shows from there to the end of the table.
d) the 'prev' button gets an error from line 1325 of jquery.dataTables.js that aoData is is undefined: [code] if ( oSettings.aiDisplay.length !== 0 )
{
var iStart = oSettings._iDisplayStart;
var iEnd = oSettings._iDisplayEnd;
if ( oSettings.oFeatures.bServerSide )
{
iStart = 0;
iEnd = oSettings.aoData.length;
}
for ( var j=iStart ; j
This discussion has been closed.
Replies
The first lot of data shows correctly and the page position shows:
Showing 1 to 25 of 107 entries
Then when scrolling down to trigger the next page, i get the next lot of data as i would expect (So the data is correct)
But it shows the following:
Showing 1 to 107 of 107 entries
And won't load anymore so all the next entries are not being displayed.
If i remove the "'iDisplayLength' => '25'," setting it works fine. But setting that manually causes it to break.
In addition another issue occurs when using infinite scrolling with a table set to bigger then the first result set.
Say setting sScrollY to 400px and then when having rows that take up less space (Like say ten) then that sScrollY will cause the scroll bar not to show up, thus meaning you can't scroll and cause the additional rows of data to show up.
I was getting a similar issue when using the following:
'iDisplayLength' => '25',
I changed it to this and had no more issues and everything worked correctly:
'iDisplayLength' => 25,
Allan
yes, that was exactly it. I removed the quotes and everything flew perfectly.
p.s. It also removed the need for my next call which was going to be "Why does the info show as 'records 1 to 020 of 1,922'"? (i.e. have a leading zero!)
Thanks again to you both,
Pete.