question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to disable `Pager` on `Pagination`

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

The pagination component is heavily oriented towards “Offset-style Pagination” (see https://dev-blog.apollodata.com/understanding-pagination-rest-graphql-and-relay-b10f835549e7 for an overview of different types of pagination). There is nothing wrong with that. However, there are cases where the end-user experience necessitates a “Cursor-style Pagination”, i.e. infinite loading of a stream of real-time data, and in such a case, page numbering (or the Pager) does not really work because we do not know the “cursor” for every page.

What does the proposed API look like?

I believe this requires a change on https://github.com/react-component/pagination as well. I propose a new prop like showPager (taking inspiration from how the other props are named). To preserve compatibility with existing uses of Pagination, I also propose the default value be set to true. I understand that it is not too difficult to mimic a simple next / previous pagination via buttons, but having this option is more convenient for end-users (i.e. the developers).

Having a closer look at the API, I believe disabling the Pager alone might not be sufficient to achieve cursor-style pagination as it still has some knowledge of a “page number” in other parts.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:16
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

9reactions
DeadcatDevcommented, Apr 25, 2018

+1 for this @MrSaints i need it too. When You have small table with like 1-4 pages i really don’t need pagers and don’t want it at all.

PS. Moreover i need option for count ‘results’ not pages like from “page 1/3” => “posts 1-10/27” so i will ask for it too but better will be just to add item renderer as it is done for ‘next/page/prev’ items in pagination API.

8reactions
annjawncommented, Aug 11, 2019

The quick and dirty solution is to simply hide the stuff between the < and > arrows

.ant-pagination-item,
.ant-pagination-jump-next,
.ant-pagination-jump-prev {
    display: none;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How do disable paging by swiping with finger in ViewPager ...
To enable / disable the swiping, just overide two methods: onTouchEvent and onInterceptTouchEvent . Both will return "false" if the paging was disabled....
Read more >
How to disable views pager programatically in certain cases
You can disable it by setting items per page to zero. $view->setItemsPerPage(0);. If you want to limit the amount of items without pager...
Read more >
Disable default screen paging on show command. Is it possible?
I know in the cli you can pipe the command to "| no-more" to temporarily disable paging, but this doesn't help with mgmt...
Read more >
Disable Paging - MSDN - Microsoft
You can set the report's InteractiveHeight to 0 to disable paging. -Chris. Thursday, October 5, 2006 8:50 PM ...
Read more >
1883340 – Unable to disable LDAP paging using Active ...
You can disable paging by setting page_size to 0, which should return all query data from LDAP in a single response. I have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found