pagination issue when selecting all (-1) - last item class is failing to be disabled
pagination issue when selecting all (-1) - last item class is failing to be disabled
when selecting all from the pagination drop down, value -1, the li.last list item is failing to past the test to add the class "disabled."
Lets say the list is 37 items long. When I debug the line of code
if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
the values for oPaging.iTotalPages === -37
local values :
iEnd : -37
oPaging Object
oPaging.iEnd : 37,
oPaging.iFilteredTotal: 37
oPaging.iLength: -1
oPaging.iPage: 0,
oPaging.iStart: 0,
oPaging.iTotal: 37,
iTotalPages: -37
the disabling of the class works as expected when selecting all other values and when searching and returning zero search results
Can anyone suggest a fix for this bug?
Lets say the list is 37 items long. When I debug the line of code
if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
the values for oPaging.iTotalPages === -37
local values :
iEnd : -37
oPaging Object
oPaging.iEnd : 37,
oPaging.iFilteredTotal: 37
oPaging.iLength: -1
oPaging.iPage: 0,
oPaging.iStart: 0,
oPaging.iTotal: 37,
iTotalPages: -37
the disabling of the class works as expected when selecting all other values and when searching and returning zero search results
Can anyone suggest a fix for this bug?
This discussion has been closed.
Replies
Allan
// Add / remove disabled classes from the static elements
when i inspect the oSetting object, the iTotalPages value is -37 which in this case its the negative values of all records, 37
Allan
Allan
/* Set the defaults for DataTables initialisation */
$.extend( true, $.fn.dataTable.defaults, {
'iDisplayLength' : 15,
'aLengthMenu': [[10, 15, 25, 50, -1], [10, 15, 25, 50, "All"]],
// bootstrap pagination from http://datatables.net/media/blog/bootstrap_2/DT_bootstrap.js
'sDom': "TRrt<'table-controls'<'pull-left'l><'pull-right'ip>>",
'sPaginationType': 'bootstrap'
}
);
however if you go to http://datatables.net/media/blog/bootstrap_2/ and edit the pages html drop down and replace the last drop down option with -1 and "all" you can recreate the bug. Next will be blue and not have the disabled class added to "next"
Thanks for flagging this up.
Regards,
Allan