Pager: correcting page calculation. Fixes #468

This commit is contained in:
Mottie 2013-12-20 08:45:34 -06:00
parent 6d379a78b4
commit e3a4f374af
2 changed files with 2 additions and 2 deletions

View File

@ -562,7 +562,7 @@
p.page = $.data(table, 'pagerLastPage') || p.page || 0;
p.size = $.data(table, 'pagerLastSize') || parseInt(pg.find('option[selected]').val(), 10) || p.size || 10;
pg.val(p.size); // set page size
p.totalPages = Math.ceil( Math.min( p.totalPages, p.filteredPages ) / p.size );
p.totalPages = Math.ceil( Math.min( p.totalRows, p.filteredRows ) / p.size );
if ( triggered ) {
$(table).trigger('updateRow');
setPageSize(table, p.size, p);

View File

@ -759,7 +759,7 @@ tsp = ts.pager = {
p.page = $.data(table, 'pagerLastPage') || p.page || 0;
p.size = $.data(table, 'pagerLastSize') || parseInt(p.$size.find('option[selected]').val(), 10) || p.size || 10;
p.$size.val(p.size); // set page size
p.totalPages = Math.ceil( Math.min( p.totalPages, p.filteredPages ) / p.size );
p.totalPages = Math.ceil( Math.min( p.totalRows, p.filteredRows ) / p.size );
c.$table.removeClass('pagerDisabled');
if ( triggered ) {
c.$table.trigger('updateRow');