Update pagination when filter is selected? - jquery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spyderfusion02
    New Member
    • Jan 2010
    • 2

    Update pagination when filter is selected? - jquery

    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.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Since you're hiding elements for the filter, in the paginate function, check the shown elements (display:block) for number_of_items here:
    Code:
    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.

    Comment

    Working...