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
23
votes
11 answers

Pagination for search results laravel 5.3

Pagination search results I have just started with Laravel and I am trying to make a search function with proper pagination. The function works for page one but on page two it doesn't. I think it's not giving the results to the next page but I can't…
Casper Spruit
  • 944
  • 1
  • 13
  • 31
23
votes
12 answers

Laravel - Union + Paginate at the same time?

Brief: I am trying to union 2 tables recipes and posts then add ->paginate(5) to the queries. But for some reason I get this error: Cardinality violation: 1222 The used SELECT statements have a different number of columns (SQL: (select count(*)…
Lior
  • 277
  • 1
  • 2
  • 6
23
votes
3 answers

Efficient pagination and database querying in django

There were some code examples for django pagination which I used a while back. I may be wrong but when looking over the code it looks like it wastes tons of memory. I was looking for a better solution, here is the code: # in views.py from…
Lucas Ou-Yang
  • 5,505
  • 13
  • 43
  • 62
22
votes
2 answers

Paginated search results with LINQ to SQL

What's the best pattern to get paginated results with LINQ to SQL? I have the following scenario: Suppose I want to search items table by description. I can easily do: public IQueryable FindItemsByDescription(string description) { return…
Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292
22
votes
3 answers

Paginate Multiple Models in Kaminari

I'm creating a search page that will do an application wide search on users, posts, and comments. I currently have: # POST /search def index query = params[:query] @users = User.search(query).page(params[:page]) @posts =…
Stussa
  • 3,375
  • 3
  • 24
  • 35
22
votes
2 answers

T-SQL Skip Take Stored Procedure

I don't seem to be having much luck on this site, still forever the optimist, I will keep trying. I have two tables, Journals and ArticleCategories that are joined using the this query: SELECT Journals.JournalId, Journals.Year, …
Pete Davies
  • 1,011
  • 5
  • 18
  • 27
22
votes
7 answers

How To Change itemsPerPageLabel in mat-paginator in Angular 6+

I am using Angular 6.0.3 with Angular Material 7.1.0, I have my paginator in a separate component (that is not the app.component). What I have tried so far: Created separate ts file called myPagniator.ts: import {MatPaginatorIntl} from…
Edward Sun
  • 277
  • 1
  • 2
  • 11
22
votes
2 answers

iOS - How to make the tableview use paginated API output?

An API I am writing has about 2000 records, returned in JSON via a simple RESTful API I have written. To reduce issues with lots of data, I want to use pagination so that I only return say the first 10 or first 20 per request via like an offset or…
zardon
  • 301
  • 1
  • 2
  • 9
22
votes
5 answers

PagedList using LINQ Skip and Take, but show paging using Count of results

I am trying to display a filtered list of of products, based on Category filter and ItemsPerPage but I'm having some issues when trying to use it with PagedList. Someone with PagedList expertise could advice me if I need to write my own pagination…
badboy11
  • 541
  • 1
  • 6
  • 19
22
votes
4 answers

Spring Data JPA Pagination (Pageable) with Dynamic Queries

I have a simple query as follows "select * from USERS". I also use Pageable to enable pagination. This query may have optional predicates based on the given parameters being null or not. For example if "code" parameter is given and not null, then…
led
  • 611
  • 4
  • 11
  • 18
22
votes
5 answers

Show page items count in django pagination

I'm trying to figure out how to show something like "Showing 1-10 of 52" using django pagination in my templates. I accomplished the pagination itself but nothing comes to my mind about this requirement. Any ideas?
webgonewild
  • 245
  • 1
  • 2
  • 6
22
votes
2 answers

Doctrine2 Paginator getting total results

Right away I would say, that I read this question Doctrine2 Paginator, but it doesn't give me enough information regarding the title of my question. When I used Doctrine1 I was getting the result with such code for example: $list = $this->query …
Eugene
  • 4,352
  • 8
  • 55
  • 79
22
votes
6 answers

C# Entity Framework Pagination

Is there a way to get the row count of a complex Linq query and millions of records without hitting the db twice or writing 2 separate queries?? I might have my own suggestion. Write a stored procedure, but I'm good with MySQL not MSSQL. Any better…
Jason Foglia
  • 2,414
  • 3
  • 27
  • 48
21
votes
3 answers

Is there any better option to apply pagination without applying OFFSET in SQL Server?

I want to apply pagination on a table with huge data. All I want to know a better option than using OFFSET in SQL Server. Here is my simple query: SELECT * FROM TableName ORDER BY Id DESC OFFSET 30000000 ROWS FETCH NEXT 20 ROWS ONLY
21
votes
1 answer

How can I use Pageable in @RestController?

I know the Pageable comes from spring-data- domain. Is there any elegant way to directly use org.springframework.data.domain.Pageable in @RestController? I tried following. @RequestMapping(method = RequestMethod.GET, path =…
Jin Kwon
  • 20,295
  • 14
  • 115
  • 184