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.

Sorting resets paging should be an option

See original GitHub issue

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior When sorting event is fired, the page is set back to first one.

Expected behavior When sorting event is fired, it should stay on current page.

Reproduction of the problem

  1. http://swimlane.github.io/ngx-datatable/#client-sorting
  2. Select page 4
  3. Sort by any column

What is the motivation / use case for changing the behavior? When you have server side Huge paging, and are, for example, on page 80 from 100- you do some sorting and ‘Bang’ you are back on page 1. After that you have to get back to page ~20 or 80 to get same results. Very annoying.

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] Up to date Chrome

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:8

github_iconTop GitHub Comments

5reactions
hankhsutwcommented, Nov 10, 2017

we need this feature as well. with server side paging , we expect to stay on the same page after sorting.

1reaction
salwagtcommented, Sep 13, 2021

<ngx-datatable #tableRows (sort)=“onSort($event)” …

@ViewChild(‘tableRows’) table: any;

Try to add this in onSort() function: this.table.bodyComponent.updateOffsetY(this.page.offset); this.table.offset = this.page.offset;

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should the pagination be reset when changing the order?
You can see that both filtering and sorting come before pagination. This means that whenever the order changes (sort), you should repaginate ...
Read more >
[Resolved] Sorting resets when pagination is used - Toolset
Hello,. I just found out that the sorting that I have on my custom search resets every time I go to a new...
Read more >
[Solved] ASP.Net GridView Filter resets on Sorting and Paging
I have a search for my GridView and I would like to use the Sort function of the GridView to sort my search...
Read more >
Announcing changes to views pagination and sorting user ...
There will not be an explicit option for jumping to the last page. Changes to sorting user profile pages. Note: The changes described...
Read more >
Sorting columns does not reset to first page - Telerik
Hello Tim, Basically such behavior is not supported. However you can try to use the dataSource requestStart event to check if the Grid...
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