Questions tagged [pagination]

Pagination is the process of dividing information into discrete pages.

Filter by
Sorted by
Tagged with
1313 votes
15 answers

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 ...
Mathieu Longtin's user avatar
777 votes
32 answers

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 ...
Johnny's user avatar
  • 9,745
595 votes
19 answers

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)?
Panagiotis Korros's user avatar
354 votes
12 answers

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), ...
2arrs2ells's user avatar
  • 3,637
343 votes
13 answers

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 ...
andi's user avatar
  • 14.3k
319 votes
36 answers

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.
Thomas's user avatar
  • 10.3k
285 votes
9 answers

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 ...
aryaxt's user avatar
  • 76.3k
259 votes
22 answers

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 ...
Micael's user avatar
  • 6,950
235 votes
4 answers

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....
Tim's user avatar
  • 5,029
214 votes
18 answers

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?
Earlz's user avatar
  • 62.1k
195 votes
6 answers

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 ...
Lars Holdgaard's user avatar
176 votes
16 answers

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 ( ...
marcgg's user avatar
  • 65.1k
158 votes
14 answers

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 ...
Nyxynyx's user avatar
  • 61.5k
137 votes
12 answers

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 ...
Karl Guertin's user avatar
  • 4,346
133 votes
6 answers

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='...
Tomarto's user avatar
  • 2,755
131 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, ...
SalmaFG's user avatar
  • 2,052
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: ...
atp's user avatar
  • 30.3k
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....
StoneHeart's user avatar
  • 15.8k
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() ...
Deepak's user avatar
  • 3,134
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 ...
Toseef Khilji's user avatar
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's user avatar
  • 187k
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 ...
Chad Johnson's user avatar
  • 21.2k
107 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 ...
Benny's user avatar
  • 8,557
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 ...
rokridi's user avatar
  • 1,565
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 ...
user3127109's user avatar
  • 3,441
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: <div class=&...
Nagendra Varma's user avatar
90 votes
3 answers

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.
ktm's user avatar
  • 6,025
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: On this page I sort a list of users by their first_name. Without a ...
vagabond's user avatar
  • 1,717
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. ...
randombits's user avatar
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 ...
Brian's user avatar
  • 5,951
77 votes
14 answers

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 ...
SwiftDeveloper's user avatar
76 votes
12 answers

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 ...
Nitesh's user avatar
  • 823
76 votes
11 answers

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-...
Drunken Daddy's user avatar
75 votes
7 answers

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?
briantaurostack7's user avatar
74 votes
8 answers

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 ...
chinesewhiteboi's user avatar
73 votes
13 answers

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 ...
Jiew Meng's user avatar
  • 85k
72 votes
24 answers

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 |------------------...
user2094178's user avatar
  • 9,224
72 votes
3 answers

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: ...
Roman's user avatar
  • 3,809
67 votes
5 answers

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 ...
Faery's user avatar
  • 4,552
65 votes
19 answers

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 ...
Bappa's user avatar
  • 799
65 votes
5 answers

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 ...
Micah's user avatar
  • 112k
62 votes
4 answers

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 = ...
user3128673's user avatar
62 votes
10 answers

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 ...
hpique's user avatar
  • 119k
58 votes
7 answers

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 ...
Nyxynyx's user avatar
  • 61.5k
57 votes
13 answers

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....
user2067888's user avatar
  • 1,085
56 votes
9 answers

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 ...
jrutter's user avatar
  • 3,173
56 votes
6 answers

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?
Nachiket's user avatar
  • 6,041
56 votes
8 answers

How to do pagination in SQL Server 2008

How do you do pagination in SQL Server 2008 ?
Omu's user avatar
  • 70k
55 votes
6 answers

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 the results paginated. In my API ...
Bill Noble's user avatar
  • 6,506
55 votes
1 answer

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 '...
lexu's user avatar
  • 8,776

2 3 4 5