From e4dc931a8e4cb36daaeff8f268e97001c02c9689 Mon Sep 17 00:00:00 2001 From: natrajsr Date: Tue, 29 Apr 2014 11:17:02 +0530 Subject: [PATCH] Update jquery.twbsPagination.js We would definitely require reset paging functionality which will recreate the paging for the same paging container. I believed, this would be the right way of doing it. Use Case: -------- Reset the content after traversing to page 5 Steps: ------ 1. Update the content 2. User select the page number 5. Paging container shows paging options as First, Previous, 3,4,5, Next, Last 3. Updates Content with the different set of result which has more content 4. Paging has to be reset from start index 1 --- jquery.twbsPagination.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jquery.twbsPagination.js b/jquery.twbsPagination.js index 7c52bd7..0ce1ed8 100644 --- a/jquery.twbsPagination.js +++ b/jquery.twbsPagination.js @@ -244,6 +244,10 @@ return ( methodReturn === undefined ) ? $this : methodReturn; }; + + $.fn.resetPaging = function () { + $(this).data('twbs-pagination', null); + }; $.fn.twbsPagination.defaults = { totalPages: 0,