Questions tagged [pagination]

Pagination is the process of dividing information into discrete pages.

Filter by
Sorted by
Tagged with
4 votes
3 answers
142 views

Setting the page number with a default

Consider this code segment: if (empty($_GET)) { $page_number = 1; } else { $page_number = $_GET["page_number"]; } I wonder if there is a better, more ...
Hai Vu's user avatar
  • 650
3 votes
1 answer
191 views

jQuery wait for all paginations

I want to download data for all of my repos from the Github API. Github paginates their responses and includes a header Link type:"next" when there's another page ...
irbanana's user avatar
  • 133
7 votes
1 answer
4k views

Java 8 spliterator for paged results

Summary: I am using an API which returns paged results. I want to have these results as Java 8 Stream and implemented a ...
lexicore's user avatar
  • 223
2 votes
1 answer
213 views

Listing employees, categorized by license expiration date

I am working on a personal project and I have hit a wall. I know I am writing bad code and I really want to refactor the code below. The application has three tables on the same page. Each table ...
Benjamin's user avatar
2 votes
1 answer
204 views

Maintaining state in a pagination handler

In my application I wrote a pagination code that retrieves data from the server as the user scrolls down. In this case, I need to mantain the current page, whether a request is being processed, and ...
victor's user avatar
  • 233
3 votes
1 answer
2k views

Generic paging algorithm

I have made a simple pagination algorithm. It shows "next" and "previous" buttons when appropriate. It also limits the amount of buttons if the page amount exceeds a certain amount, e.g. ...
Johan's user avatar
  • 33
3 votes
1 answer
1k views

AngularJS application to display 10 search results at a time

I am working on an angular application. I have written a controller for a page which gets 10 objects from an api. On clicking the next button, it gets the next 10 objects and so on. I have also added ...
doctorsherlock's user avatar
1 vote
0 answers
2k views

Pagination from resultset for JTable

I am trying to create simple app, where I need a pagination for my JTable. I want have there buttons with number for all "pages" in my JTable. I have code here: Class Customer: ...
Jan444444's user avatar
8 votes
1 answer
3k views

GET with paging, sorting and filtering

I have a GET method that handles paging, filtering, and sorting. Development has been fairly rapid and I'm not completely sold on some of the implementation. A few assumptions have to be made for this ...
G. J.'s user avatar
  • 83
3 votes
1 answer
13k views

Java - Creating a Paginated List

I need to create a class which acts as a paginated list. My use case is like this: I am writing a library which makes a service call to fetch a List<obj>. ...
AgentX's user avatar
  • 131
3 votes
1 answer
773 views

WAI-ARIA and Pagination

I would like to get some advice on WAI-ARIA markup I have added to my paginated post navigation. Does this look correct, am I missing anything? Should anything be added/removed to the current page ...
Benjamin's user avatar
  • 131
1 vote
1 answer
903 views

Make jquery pagination more efficient

I am trying to create pagination with pure PHP and jquery. I have done this and it works exactly how I want it to work. Essentially I get all products from my database using PHP. I then populate the ...
Matthew Smart's user avatar
0 votes
1 answer
234 views

Javascript pager logic

I implemented a function for pager link creation, it looks like this: ...
Daniele's user avatar
  • 75
2 votes
0 answers
678 views

Pagination links for various lists using Spring-HATEOAS

I'm using Spring HATEOAS to create some links on my REST API. However, the entities i'm returning are very close, so the code to generate the links are the same: ...
Kaidjin's user avatar
  • 123
4 votes
1 answer
2k views

Joining huge CSV files and splitting the result into batches

I've got ~20GB of data about the same subject, concatenated from small files of 16kB, each produced by different measurement equipment. They share some headers (on the example: B, D & E) and they ...
Thomas Ayoub's user avatar
2 votes
1 answer
80 views

Optimize KnockoutJs Pagination Computed Function

I have written a function that builds an array of paging options for rendering on the view. I have modelled it after DataTables for jQuery, a live example with lots of data is available here: http://...
Sean Thorburn's user avatar
5 votes
1 answer
213 views

Paginating blog posts from SQL server using nested LINQ statements

I made an ASP.NET MVC application using Entity Framework for code-first migrations to the SQL Server database. I also use Unity (DI/IoC) for managing the services and repositories. I made an overview ...
H. Pauwelyn's user avatar
1 vote
1 answer
219 views

Product inventory database

I just finished writing a program which working with a database. Throughout the process when working with people to get past some of the hurdles I faced I was ridiculed for my SQL statements. I have ...
wuno's user avatar
  • 145
0 votes
1 answer
384 views

HTML Pagination Generator

I have created a function that helps me generate pagination really easily but I am concerned about its performance mainly. The function accepts 2 parameters: A list of items (has meaning in the ...
php_nub_qq's user avatar
2 votes
0 answers
330 views

A clean way to do CRUD with pagination

What do you think about the following approach to CRUD? Here is the reading+pagination example. DTO types have Dto* prefix, EF Entity Types have E* prefix. DAL example: ...
Dmitry Nogin's user avatar
  • 6,133
4 votes
2 answers
3k views

Pagination algorithm based on scores

I need to divide scoreResult into pages (which is already ordered by score column from highest to lowest), and each page cannot contain too many records (e.g. 12 is ...
Lin Ma's user avatar
  • 3,433
5 votes
1 answer
168 views

GitHub API client

Here is my Haskell program designed to list all of my GitHub repos along with their descriptions and languages via the GitHub JSON APIs: ...
Richard Cook's user avatar
1 vote
1 answer
6k views

Pagination logic created from scratch

I created this JavaScript class using ES6-ES7 syntax to return an array of page numbers and ellipsis points (null) to be consumed by a function which will create a styled paginator. What I am looking ...
Mike's user avatar
  • 195
5 votes
1 answer
1k views

Pagination PHP function - Can this code be made more efficient?

First of all, I didn't write this code from scratch, I'm pretty sure I took it from an online tutorial and modified it slightly to suit my needs. Can the code be improved in any way? I feel it's quite ...
Michael LB's user avatar
4 votes
1 answer
2k views

Change the limit from CakePHP 3 Paginator by click in link inside an <option>

I'm using the CakePHP 3.0 to paginate some content, but I can't find a way to change the limit (user on browser choose the limit of content displayed on screen) using ...
Ricardo's user avatar
  • 265
8 votes
1 answer
429 views

Non-curses pager in C

I have written a pager in C that is supposed to be used in systems where curses is not installed (or broken). It can also be used as a system-wide pager, it works ...
user avatar
5 votes
2 answers
559 views

Rails guestbook with new, index, and Kaminari pagination in the same method

I created a guestbook that on one page displays both the form for a new entry and all of the entries that have been created so far. I am trying to use Kaminari for pagination for the entries. Right ...
Jack's user avatar
  • 51
10 votes
1 answer
561 views

Simple pager in C

I have written a simple pager in C. It works fine for most things, but I'd like to know how it can be improved. Specific things I'm looking for are if there are size and/or speed improvements to be ...
user avatar
4 votes
1 answer
522 views

Github pagination

I wanted to copy the behavior of github's pagination. Here is what it turned out: http://jsbin.com/dihohiseca/5/edit?js,output It works fine, but I have a feeling that there is a lot of room for ...
user3568719's user avatar
2 votes
3 answers
2k views

PHP page pagination

I think my code is sloppy can anyone give me advice to do it better? This is a page pagination that get rows from mysql db and calculate the number of pages. ...
Patiphan Mahamat's user avatar
4 votes
1 answer
5k views

WebApi Get with paging

How can I improve this code? ...
Roman Marusyk's user avatar
1 vote
2 answers
1k views

Getting paginated data from ajax call and putting the data on the page

At the moment, it gets the first page worth of data and then each subsequent page when the user scrolls down to the bottom of the page. My JavaScript/jQuery level is fairly weak, however I have ...
Josh Kirkpatrick's user avatar
3 votes
0 answers
1k views

Combining pagination and non query grouping in Slick 3.0

I have the following tables: val postTable = TableQuery[Posts] val postTagTable = TableQuery[PostTags] val tagTable = TableQuery[Tags] One post can have multiple ...
thwiegan's user avatar
  • 131
12 votes
1 answer
3k views

Creating a page number array for pagination

I have written a small function to generate an array of page numbers for displaying a pagination. The inputs to the function is an active page number p, and the max page number. The function will ...
rahul's user avatar
  • 243
5 votes
1 answer
3k views

Pagination implementation for a blog system

Last night I was working on a project that I've embarked upon as a learning exercise. I decided to add a pagination feature to my blog system. I made an attempt at it and got close... but I decided to ...
Dan Beaulieu's user avatar
4 votes
3 answers
551 views

Page Enum with overridden methods for the first and last members

I am managing the changing of views in an Android app using this enum and associated methods. I am particularly interested in the Page enum's use of overriding <...
Derek's user avatar
  • 225
2 votes
1 answer
7k views

Node.js Paging with Mongodb

I want to create variable paging on Node.js with MongoDB. I use MongoJS on client side create a request: ...
kamerrer's user avatar
2 votes
2 answers
6k views

Applying limit and offset to an array

I'm refactoring an old gateway and came across the following method: ...
dax's user avatar
  • 197
2 votes
0 answers
78 views

Fetching photos and tweets related to selected publications

1) Postgresql 2) User has_many :reports 3) Report belongs_to :user 3) Report belongs_to :publication 4) Publication has_many :reports 4) Publication scope :photos, -> ...
Legendary's user avatar
5 votes
1 answer
152 views

Related links for WordPress posts

I have written the following class which is part of a pagination system in Wordpress. The class works as expected and also works as expected when used in the system. Just as background, the class ...
Pieter Goosen's user avatar
3 votes
1 answer
2k views

Paginate a long unordered list

I'm working in an application where there's a long unordered list of items that have to be paginated. New items are added to the list regularly, and the items come from a database. The only control I ...
Larz's user avatar
  • 275
2 votes
0 answers
382 views

Resource that use two different services and query with pagination when resolved

I'm learning Angular and I don't like my current approach. The current controller uses first Geolocation service and when ...
luzny's user avatar
  • 131
2 votes
0 answers
2k views

Pagination handlebars helper

I've build a handlebars helper that takes n total pages and currentPage and returns the HTML for the page number links, skipping ...
Tom's user avatar
  • 431
9 votes
1 answer
5k views

RSpec test for pagination

This is a Rspec test for pagination in Rails project. I'm not sure if I should write the test in spec/requests or ...
ironsand's user avatar
  • 171
4 votes
1 answer
394 views

Optimizing pagination of HTML tables

I'd like to share my implementation to you to confirm if it's a correct way to solve my problem. I have a list of products which have an attributes table and a description table (both in html_encoded ...
Anonymous's user avatar
  • 141
11 votes
4 answers
496 views

Cutting it to Pages

I was working on representing a large List of information on a number of different pages, and a colleague of mine suggested that I try to make a generic method for ...
bazola's user avatar
  • 8,579
3 votes
1 answer
22k views

WPF ListView Pagination using MVVM Pattern

A few days ago, I was looking for simple pagination example and I decided to write my own version. It is one of my first apps using MVVM Pattern, so I am not sure I did right. I would appreciate if ...
Dess's user avatar
  • 31
3 votes
2 answers
1k views

Pagination filtering

I want to check if there is page variable (in URL) and if it is, if it's correct - it cannot be number 1 because this is default page and it should be valid int ...
Marcin Nabiałek's user avatar
3 votes
1 answer
2k views

Pagination object oriented

This a little pagination script that I am writing "Object Oriented" and I have no idea how to set the current page equal to total page, if the current page is greater. I also would really like it if ...
Jean's user avatar
  • 71
5 votes
2 answers
3k views

Adding a bulk of items in the middle of a sparse array

I'd like to add a bulk of items into a sparse array, starting at a certain index. I came along this requirement in order to accomplish client side pagination while not retrieving all data from server (...
user40171's user avatar
  • 187