binary-hideout/elecritic

Paginator for products of a category

Closed this issue · 2 comments

There should be a paginator in CategoriesCategory to allow to see multiple products without overextending the page.

A paginator is something like this:

paginator

Okay, definitely, just help me get over with the logic...
-When the user clicks the next page button or the number of the following page:
a) the method should call the page again but with another parameter (number of page, with quantity of pages determined beforehand)
b) the method will only be a query dragging different data, a reload is necessary as well, but it will only be a query asking for the next elements on the list(if they exist)
c) another one
Which one is it?? Thanks in advance

right now the method queries the DB for a Category object which includes a list of products, so it would be like a page reload, but I think it wouldn't need a parameter so it wouldn't be possible to access to a certain page number from a link.

The method could be refactored to query the category and the products separately so it wouldn't be necessary to reload the page, and to use a parameter for the page number.