1

I have 1001 entries to be shown .. I have a dropdown box listing how many entries to be shown per page . (10,20,30,40,50). Initially i show 10 entries per page so the number of pages would be 101 .The text content initially shows page 1 of 101. Now when i change the number of entries to be shown per page to 20 , an javascript function is called and the max_page is set to 51 in tht function and text content is showing page 1 of 51 . Upto this its working fine . Now when i click on the last button , it shows the text content as page 101 of 101 ..instead of page 51 of 51 .. further clicks on it are showing wrong values .

$(document).ready(function()
{
$('.pagination').jqPagination({
link_string : '/?page={page_number}',
max_page    :total_pages,
paged       : paging
});

});


$("#items").change(function(){
$('.pagination').jqPagination({
max_page    : total_pages

});
});
Praveen
  • 366
  • 3
  • 12
  • I feel two instances of jqpagination is created . When i click on the arrow keys first instance is used .. how can i change the max value in first instance itself .. – Praveen May 10 '13 at 10:58

1 Answers1

8

You need to update the max page (as follows) instead of re-instantiating the plugin.

$('.pagination').jqPagination('option', 'max_page', 51)
Ben Everard
  • 13,652
  • 14
  • 67
  • 96