Update max_page in jqpagination -


i have 1001 entries shown .. have dropdown box listing how many entries shown per page . (10,20,30,40,50). show 10 entries per page number of pages 101 .the text content shows page 1 of 101. when change number of entries shown per page 20 , javascript function called , max_page set 51 in tht function , text content showing page 1 of 51 . upto working fine . when click on last button , shows text content page 101 of 101 ..instead of page 51 of 51 .. further clicks on 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  }); }); 

you need update max page (as follows) instead of re-instantiating plugin.

$('.pagination').jqpagination('option', 'max_page', 51) 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -