You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to dynamically set the number of rows to be paginated as we perform an iterative search through our dataset. As far as I can see, the plugin only allows this to be set at creation.So I have created a new binding, thus -
containers.bind('setNumRows', {numPages:np}, function(evt, numRows) {
var current_page = $(this).data('current_page');
console.warn("jquery.paginate : setNumRows " + numRows + " " + current_page) ;
// Create a sane value for maxentries from the supplied number of rows
numRows = (!numRows || numRows < 0)?1:numRows;
if (numRows != maxentries)
{
maxentries = numRows ;
// calculate how many pages we now need
var newMaxPage = Math.ceil(maxentries/opts.items_per_page);
console.warn("jquery.paginate : setNumRows updating number of pages to " + newMaxPage) ;
// check if the current page is not within the new current set of pages
if (current_page > newMaxPage)
current_page = newMaxPage ;
renderer = new $.PaginationRenderers[opts.renderer](maxentries, opts);
links = renderer.getLinks(current_page, paginationClickHandler);
containers.empty();
if(newMaxPage > 1 || opts.show_if_single_page) {
links.appendTo(containers);
}
}
return false;
});
(sorry about leaving in the console.warn debugging).
Is this appropriate for inclusion in your excellent plugin?
Kind regards
Chris
The text was updated successfully, but these errors were encountered:
Gabriel,
We need to dynamically set the number of rows to be paginated as we perform an iterative search through our dataset. As far as I can see, the plugin only allows this to be set at creation.So I have created a new binding, thus -
(sorry about leaving in the console.warn debugging).
Is this appropriate for inclusion in your excellent plugin?
Kind regards
Chris
The text was updated successfully, but these errors were encountered: