Closed liranp1 closed 6 years ago
Look at https://github.com/wikiti/jquery-paginate#advanced-options at the 'limit' option. The example right below it uses limit to only show 10 results per page.
@EFinish That did not answer @liranp1 's question. I have the same question as @liranp1 too.
I did a small trick for displaying page numbers within the n+-3 range of current select page:
$(document).ready(function() {
$('#acc-invoice-list').paginate({
limit: 10,
onCreate: function(obj) {prettyPagination(3);},
onSelect: function(obj, i) {prettyPagination(i+1);}
});
});
function prettyPagination(currentPageIndex) {
$('.page-navigation a').css('display', 'none');
$('.page-navigation a').slice((currentPageIndex-3) <0 ? 0 : currentPageIndex-2, currentPageIndex).css('display', 'inline-block');
$('.page-navigation a').slice(currentPageIndex, currentPageIndex+4).css('display', 'inline-block');
// always display previous & next navigations
$('.page-navigation a').slice(0, 2).css('display', 'inline-block');
$('.page-navigation a').slice(-3, -1).css('display', 'inline-block');
$('.page-navigation a').last().css('display', 'inline-block');
}
@khe817 I am mistaken. Thank you for correcting me.
thank you all for your help! i works amazing
i have a table with more then 1000 rows. i limit the results to 15 result per page. but in the pages numbers i see 1-70 that is allot, is there a way to display only few and add ' ...' so user will know there is more?