Questions tagged [pagination]
Pagination is the process of dividing information into discrete pages.
17,777
questions
1340
votes
16
answers
2.4m
views
How do I limit the number of rows returned by an Oracle query after ordering?
Is there a way to make an Oracle query behave like it contains a MySQL limit clause?
In MySQL, I can do this:
select *
from sometable
order by name
limit 20,10
to get the 21st to the 30th rows (skip ...
784
votes
32
answers
789k
views
Check if a user has scrolled to the bottom (not just the window, but any element)
I'm making a pagination system (sort of like Facebook) where the content loads when the user scrolls to the bottom. I imagine the best way to do that is to find when the user is at the bottom of the ...
605
votes
19
answers
682k
views
What is the best way to paginate results in SQL Server
What is the best way (performance wise) to paginate results in SQL Server 2000, 2005, 2008, 2012 if you also want to get the total number of results (before paginating)?
358
votes
13
answers
269k
views
API pagination best practices
I'd love some some help handling a strange edge case with a paginated API I'm building.
Like many APIs, this one paginates large results. If you query /foos, you'll get 100 results (i.e. foo #1-100), ...
342
votes
13
answers
66k
views
Pagination in a REST web application
This is a more generic reformulation of this question (with the elimination of the Rails specific parts)
I am not sure how to implement pagination on a resource in a RESTful web application.
Assuming ...
327
votes
36
answers
386k
views
How to paginate with Mongoose in Node.js?
I am writing a webapp with Node.js and mongoose. How can I paginate the results I get from a .find() call? I would like a functionality comparable to "LIMIT 50,100" in SQL.
291
votes
9
answers
366k
views
MySQL Data - Best way to implement paging?
My iPhone application connects to my PHP web service to retrieve data from a MySQL database, a request can return up to 500 results.
What is the best way to implement paging and retrieve 20 items at a ...
259
votes
22
answers
516k
views
How to do paging in AngularJS?
I have a dataset of about 1000 items in-memory and am attempting to create a pager for
this dataset, but I'm not sure on how to do this.
I'm using a custom filter function to filter the results, and ...
257
votes
4
answers
152k
views
Run a query with a LIMIT/OFFSET and also get the total number of rows
For pagination purposes, I need a run a query with the LIMIT and OFFSET clauses. But I also need a count of the number of rows that would be returned by that query without the LIMIT and OFFSET clauses....
223
votes
18
answers
358k
views
Equivalent of LIMIT and OFFSET for SQL Server?
In PostgreSQL there is the Limit and Offset keywords which will allow very easy pagination of result sets.
What is the equivalent syntax for SQL Server?
200
votes
6
answers
244k
views
Implement paging (skip / take) functionality with this query
I have been trying to understand a little bit about how to implement custom paging in SQL, for instance reading articles like this one.
I have the following query, which works perfectly. But I would ...
180
votes
16
answers
383k
views
LIMIT 10..20 in SQL Server
I'm trying to do something like :
SELECT * FROM table LIMIT 10,20
or
SELECT * FROM table LIMIT 10 OFFSET 10
but using SQL Server
The only solution I found looks like overkill:
SELECT * FROM (
...
161
votes
14
answers
156k
views
Laravel Pagination links not including other GET parameters
I am using Eloquent together with Laravel 4's Pagination class.
Problem: When there are some GET parameters in the URL, eg: http://site.example/users?gender=female&body=hot, the pagination links ...
137
votes
12
answers
39k
views
Paging in a Rest Collection
I'm interested in exposing a direct REST interface to collections of JSON documents (think CouchDB or Persevere). The problem I'm running into is how to handle the GET operation on the collection root ...
135
votes
15
answers
175k
views
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, ...
133
votes
6
answers
238k
views
Pagination on a list using ng-repeat
I'm trying to add pages to my list. I followed the AngularJS tutorial, the one about smartphones and I'm trying to display only certain number of objects. Here is my html file:
<div class='...
132
votes
10
answers
73k
views
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:
...
125
votes
4
answers
347k
views
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() ...
123
votes
10
answers
104k
views
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....
121
votes
8
answers
298k
views
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 ...
112
votes
7
answers
190k
views
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 ...
110
votes
8
answers
53k
views
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?
110
votes
17
answers
218k
views
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 ...
108
votes
13
answers
120k
views
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 ...
108
votes
18
answers
163k
views
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 ...
102
votes
36
answers
156k
views
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:
<div class=&...
90
votes
3
answers
341k
views
Simple PHP Pagination script [closed]
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.
88
votes
21
answers
37k
views
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 ...
84
votes
18
answers
90k
views
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. ...
81
votes
11
answers
232k
views
How to use paginator from material angular?
I'm new to angular and trying to implement pagination in my app. I am trying to use this material component.
With the code below, I can get length, pagesize, and pageSizeOptions in my .ts file
<md-...
80
votes
7
answers
58k
views
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 ...
77
votes
7
answers
130k
views
How to convert a list of enity object to page object in Spring MVC (JPA)?
I have a List of entities.
How do I convert it to Page Object using Spring MVC 4 and Spring Data JPA?
77
votes
14
answers
135k
views
Swift tableView Pagination
I have success working tableview with json parsing code. But may have 1000 more item so I need pagination when scrolling bottom side. I don't know how can I do this for my code shown below. For ...
76
votes
12
answers
225k
views
How to implement pagination in React
I am new to ReactJS and am creating a simple TODO application in it. Actually, it is a very basic app with no DB connection, tasks are stored in an array. I added Edit and Delete functionality to it ...
76
votes
8
answers
167k
views
Pagination in Spring Data JPA (limit and offset)
I want the user to be able to specify the limit (the size of the amount returned) and offset (the first record returned / index returned) in my query method.
Here are my classes without any paging ...
74
votes
13
answers
134k
views
Calculating item offset for pagination
this seems like very simple maths but somehow, my brain cant think ...
i am trying to implement pagination and will need to calculate the item offset to use in limiting my result set. i am having ...
72
votes
25
answers
245k
views
Custom pagination view in Laravel 5
Laravel 4.2 has the option to specify a custom view in app/config/view.php such as:
/*
|--------------------------------------------------------------------------
| Pagination View
|------------------...
72
votes
3
answers
32k
views
MongoDB ranged pagination
It's said that using skip() for pagination in MongoDB collection with many records is slow and not recommended.
Ranged pagination (based on >_id comparsion) could be used
db.items.find({_id: {$gt: ...
69
votes
5
answers
119k
views
Use Limit and Offset in Doctrine2 query
I'm trying to do the pagination, but there is an error:
[Syntax Error] line 0, col 57: Error: Expected end of string, got 'limit'
I'm not quite sure if this is the right syntax (and logic) to make ...
67
votes
5
answers
52k
views
How to implement cursors for pagination in an api
This is similar to to this question which doesn't have any answers. I've read all about how to use cursors with the twitter, facebook, and disqus api's and also this article about how disqus generally ...
65
votes
19
answers
72k
views
disable pagination if there is only one page in datatables
I am implementing datatbales and according to my requirement, most of the things have been resolved except the pagination issue. In my case for every time pagination navigation is displaying. I want ...
64
votes
5
answers
37k
views
Django Rest Framework - APIView Pagination
I have a very simple APIView, but I don't know how to setup pagination here.
In this scenario I select an Event with given pk, then I get all the NewsItems assigned to this Event.
pagination_class = ...
62
votes
10
answers
28k
views
HTML book-like pagination
How can I split the content of a HTML file in screen-sized chunks to "paginate" it in a WebKit browser?
Each "page" should show a complete amount of text. This means that a line of text must not be ...
59
votes
14
answers
107k
views
How to automatically append query string to laravel pagination links?
I am working on search filter on checkbox click, with Laravel and Ajax call. So I get results when I click on a checkbox. my query is as follows:
$editors = User::with(['editor.credentials','editor....
59
votes
7
answers
26k
views
Find total number of results in mySQL query with offset+limit
I'm doing a pagination feature using Codeigniter but I think this applies to PHP/mySQL coding in general.
I am retrieving directory listings using offset and limit depending on how many results I ...
56
votes
9
answers
42k
views
Pagination: Server Side or Client Side?
What is it best to handle pagination? Server side or doing it dynamically using javascript?
I'm working on a project which is heavy on the ajax and pulling in data dynamically, so I've been working ...
56
votes
6
answers
81k
views
How to implement pagination in Spring MVC 3 [closed]
Is there any out-of-the-box, easy to implement, standard pagination component/tag-lib or code-sample available for pagination in Spring MVC?
56
votes
8
answers
63k
views
How to do pagination in SQL Server 2008
How do you do pagination in SQL Server 2008 ?
56
votes
1
answer
175k
views
How to stretch a table over multiple pages [closed]
I have a Table (multiple rows, multiple columns, see below ) that is longer than one page.
How can I tell LaTeX to continue on the next page.
Adding a \newpage didn't work
Manually 'ending' and '...
55
votes
6
answers
27k
views
Turn off automatic pagination of Django Rest Framework ModelViewSet
I am using Django Rest Framework's ModelViewSet for one of my views. ModelViewSet uses the ListModelMixin which automatically paginates the results but I do not want to get the results paginated. In ...