By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,742 Members | 1,206 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,742 IT Pros & Developers. It's quick & easy.

Update pagination when filter is selected? - jquery

P: 2
Hey, I'm trying to get my pagination numbers to update when the user uses the filter options at the side.

Here is what I'm talking about: When you click the color - Yellow - you should only get 1 result(Giant) and only 1 page number should display. however the pagination is not updating properly and still displays all page numbers.

Here is the page (View page source to see all code including jquery)

I'm assuming I have to put the pagination function -> paginateIt() <- somewhere in the filter script when the filter is started, but im unsure where to properly place it if that's the case.

Thanks for any help on this.
Jan 9 '10 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 16,027
Since you're hiding elements for the filter, in the paginate function, check the shown elements (display:block) for number_of_items here:
Expand|Select|Wrap|Line Numbers
  1. var number_of_items = $('#content ul').children().size();
You'll probably have to change the code in the go_to and next/previous functions, but one easy way could be to add a class when filtering and paginate that instead.
Jan 10 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.