Hi So I have a div with 6 links(categories of products), the beside this I have another div which I want to fill with the products for a chosen category when a link is clicked. I have a mysql table containing all the products with each category having a unique…
If you use this plugin you have to do a few more things:
- get the number of total pages for that particular product (using COUNT(*) WHERE product_id=...) and store it into items varialble
- prepare a php script that will return the records for one page, using itemsOnPage parameter (or modify existing script)
- use onPageClick function which will call above mentioned php script to fetch pages
But documentation for this plugin is not very comprehensive. So maybe you try this one, which has a nice tutorial along with it.
I have never done any jquery/ajax pagination so I can not give you any finished code. I used PEAR Pager class for this purpose and it was doing it's job very well.
broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13
Yes, but then you have to forget all the ayax stuff. This means that on each click (either on one of the links for categories or links for pages) the wholepage will be refreshed/reloaded. This in your case is OK since about 90% of page contents gets refreshed anyway.
To use Pager for paginating DB results see this link (from the maintainer of the package) and use method #2 which is simpler.
broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13
If you do not have many results for each div you can also fake pagging. You read all the product data but display only a portion of it and hide the rest (using CSS display:none). On clicking page links you can then unhide another portion and hide previous.
broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13
Question Answered as of 2 Weeks Ago by
broj1
and
Atli