From e285fb42b05629954b6c0e9d5b8895ab9ec544f4 Mon Sep 17 00:00:00 2001 From: Leo Zhu Date: Mon, 17 Jun 2013 14:20:24 +0800 Subject: [PATCH] if iTotalPage is 0, nextPage and lastPage are also need to be disabled --- pagination/ellipses.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pagination/ellipses.js b/pagination/ellipses.js index 4247dfe..2fa9c8f 100644 --- a/pagination/ellipses.js +++ b/pagination/ellipses.js @@ -95,7 +95,7 @@ $.fn.dataTableExt.oPagination.ellipses = { $('.' + oClasses.sPagePrevious, tableWrapper).removeAttr('disabled'); } - if (oSettings._iCurrentPage === oSettings._iTotalPages) { + if (oSettings._iTotalPages === 0 || oSettings._iCurrentPage === oSettings._iTotalPages) { $('.' + oClasses.sPageNext, tableWrapper).attr('disabled', true); $('.' + oClasses.sPageLast, tableWrapper).attr('disabled', true); } else { @@ -156,4 +156,4 @@ $.fn.dataTableExt.oPagination.ellipses = { _iLastPage: iLastPage }); } -}; \ No newline at end of file +};