Pagination model--

For views that require listing a lot of data, it is necessary to section them, paging is used and in the controllers, some models already exist to do this, which have the following structure.

pagination = {
  current: 1,
  pages: 0,
  items: '10', 
  itemsPerPage: [10,20,30,50,100] //To has a list o number of items
};

The paging model also interacts with the paging functions:

  • nextPage(): Add 1 to pagination.current since this is the indicator of what page it is on.
  • backPage(): Subtract 1 from pagination.current since this is the indicator of which page it is on.

To show the sectiNOTE: The models have different names depending on the view but they all have the same soned data it is necessary that it be bounded in the following way:
startFrom: ((pagination.current-1)*pagination.items for the lower limit
limitTo: drimpagination.items for the upper limit

📘

NOTE: The models have different names depending on the view but they all have the same structure.