Questions tagged [pagination]

Pagination is the process of dividing information into discrete pages.

Pagination is the process of dividing information into discrete pages. Pagination is often used for the purpose of printing or searching information.

Pagination in Web content (HTML, ASP, PHP, and others)

On the Internet, pagination is used for such things as displaying a limited number of results on search engine results pages, or showing a limited number of posts when viewing a forum thread. Pagination is used in some form in almost every web application to divide returned data and display it on multiple pages. Pagination also includes the logic of preparing and displaying the links to the various pages.

Links

Wikipedia Pagination

17657 questions
131
votes
9 answers

MySQL pagination without double-querying?

I was wondering if there was a way to get the number of results from a MySQL query, and at the same time limit the results. The way pagination works (as I understand it) is to first do something like: query = SELECT COUNT(*) FROM `table` WHERE…
atp
  • 30,132
  • 47
  • 125
  • 187
128
votes
14 answers

Paginate Javascript array

I am trying to write a Javascript function that takes an array, page_size and page_number as parameters and returns an array that mimics paginated results: paginate: function (array, page_size, page_number) { return result; } so for example…
SalmaFG
  • 2,022
  • 3
  • 23
  • 36
123
votes
10 answers

efficient way to implement paging

Should I use LINQ's Skip() and Take() method for paging, or implement my own paging with a SQL query? Which is most efficient? Why would I choose one over the other? I'm using SQL Server 2008, ASP.NET MVC and LINQ.
StoneHeart
  • 15,790
  • 32
  • 67
  • 84
120
votes
4 answers

In Flask, what is "request.args" and how is it used?

As a Flask beginner, I can't understand how request.args is used. I read somewhere that it is used to return values of query string (correct me if I'm wrong) and how many parameters request.args.get() takes. I know that when I have to store…
Deepak
  • 3,134
  • 2
  • 24
  • 24
117
votes
8 answers

how to remove pagination in datatable

I have used Datatables in grid but need not pagination. There is a list of orders in one page and I show them in a Datatable grid but in bottom I do not want to show pagination. Is there any way to remove or hide pagination from the data table by…
Toseef Khilji
  • 17,192
  • 12
  • 80
  • 121
110
votes
8 answers

How can you do paging with NHibernate?

For example, I want to populate a gridview control in an ASP.NET web page with only the data necessary for the # of rows displayed. How can NHibernate support this?
Ray
  • 187,153
  • 97
  • 222
  • 204
110
votes
7 answers

Pagination response payload from a RESTful API

I want to support pagination in my RESTful API. My API method should return a JSON list of product via /products/index. However, there are potentially thousands of products, and I want to page through them, so my request should look something like…
Chad Johnson
  • 21,215
  • 34
  • 109
  • 207
107
votes
18 answers

UITableView load more when scrolling to bottom like Facebook application

I am developing an application that uses SQLite. I want to show a list of users (UITableView) using a paginating mechanism. Could any one please tell me how to load more data in my list when the user scrolls to the end of the list (like on home page…
rokridi
  • 1,565
  • 2
  • 11
  • 20
106
votes
17 answers

Conversion of List to Page in Spring

I am trying to convert list to page in spring. I have converted it using new PageImpl(users, pageable, users.size()); But now I having problem with sorting and pagination itself. When I try passing size and page, the pagination doesn't…
user3127109
  • 3,421
  • 8
  • 24
  • 33
106
votes
13 answers

The simplest formula to calculate page count?

I have an array and I want to divide them into page according to preset page size. This is how I do: private int CalcPagesCount() { int totalPage = imagesFound.Length / PageSize; // add the last page, ugly if (imagesFound.Length %…
Benny
  • 8,547
  • 9
  • 60
  • 93
98
votes
36 answers

Angular MatPaginator doesn`t get initialized

I have 2 components. Both have mat-table and paginators and pagination is working for one component and not working for the other component though the code is similar. Below is my html:
Nagendra Varma
  • 2,215
  • 3
  • 17
  • 26
90
votes
3 answers

Simple PHP Pagination script

I have rows of data coming from database, I would like to have a table with a simple pagination, what is the easiest way of doing it? I'd be glad if anyone could provide.
ktm
  • 6,025
  • 24
  • 69
  • 95
88
votes
21 answers

How to paginate Django with other get variables?

I am having problems using pagination in Django. Take the URL below as an example: http://127.0.0.1:8000/users/?sort=first_name On this page I sort a list of users by their first_name. Without a sort GET variable it defaults to sort by id. Now…
vagabond
  • 1,717
  • 4
  • 19
  • 21
80
votes
16 answers

Get a count of total documents with MongoDB when using limit

I am interested in optimizing a "pagination" solution I'm working on with MongoDB. My problem is straight forward. I usually limit the number of documents returned using the limit() functionality. This forces me to issue a redundant query without…
randombits
  • 47,058
  • 76
  • 251
  • 433
79
votes
7 answers

Ruby on Rails will_paginate an array

I was wondering if someone could explain how to use will_paginate on an array of objects? For example, on my site I have an opinion section where users can rate the opinions. Here's a method I wrote to gather the users who have rated the…
Brian
  • 5,951
  • 14
  • 53
  • 77