$.array.paginate
Paginate method of array helpers
Paginate the array
You may want to create a pagination or to split the data into many pages for your table, post or other components. Here you need to use paginate helper to show only entries by the page limit (I mean the limit of entries per page) and by the current page active, this method will produce a new array.
Pagination numbers or items
Creating pagination with javascript from scratch might be a bit tricky to do, so I provide a pagination helper to just solve that problem, this pagination helper will render a new array with pagination numbers in it, by using this method you guys can build a complete pagination through iteration.
Get total pages from array
Before creating a pagination, we need to know the total pages of data, items, entries or record from the array, this is why we provide a helper for just generating a number of total pages.
Showing the information of pagination and entries per page
You may want to get the information of the current entries from the current page, here we provide pageInfo and will return an object with properties such as the entries that start from the beginning of page in a number, that end to the last entries of that page in a number and the total entries in a number.
Last updated
Was this helpful?