From e1a6d572aab95acdb492110a3ca337043f9b095a Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Mon, 17 Nov 2014 10:15:26 +0000 Subject: [PATCH] Fix #125 - correct last page calculation --- pagination/input.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pagination/input.js b/pagination/input.js index 19f48cf..2ce336d 100644 --- a/pagination/input.js +++ b/pagination/input.js @@ -95,7 +95,7 @@ $.fn.dataTableExt.oPagination.input = { $(nNext).click( function() { var iCurrentPage = Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength) + 1; - if (iCurrentPage != (Math.ceil((oSettings.fnRecordsDisplay() - 1) / oSettings._iDisplayLength))) + if (iCurrentPage != Math.ceil((oSettings.fnRecordsDisplay() / oSettings._iDisplayLength))) { oSettings.oApi._fnPageChange(oSettings, "next"); fnCallbackDraw(oSettings); @@ -112,7 +112,7 @@ $.fn.dataTableExt.oPagination.input = { $(nLast).click( function() { var iCurrentPage = Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength) + 1; - if (iCurrentPage != (Math.ceil((oSettings.fnRecordsDisplay() - 1) / oSettings._iDisplayLength))) + if (iCurrentPage != Math.ceil((oSettings.fnRecordsDisplay() / oSettings._iDisplayLength))) { oSettings.oApi._fnPageChange(oSettings, "last"); fnCallbackDraw(oSettings);