This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorting with paging #2819
Comments
Please check our sorting guide at http://docs.handsontable.com/0.18.0/demo-sorting-data.html?_ga=1.165582783.1270603665.1430732719 there are not the exact cases as yours but it can help you |
Is there a workaround? Would it be possible to handle the event when column sorting changes and reload the data part through AJAX (including the sorting information in the AJAX request)? Multiple pages with sorting is a very common use case for many grids. Is it really impossible in Handsontable? Thanks! :) |
+1 |
@AMBudnik this seems like a legitimate issue to me. Sorting appears to be broken when pagination is involved. |
I'll reopen this issue for further discussion. |
@AMBudnik any updates on this? |
@rhymes unfortunately not yet. This one is pretty tricky as paging is not actually a plugin. Please stay tuned to this issue for more updates. Additionally you can check our Roadmap: https://trello.com/b/PztR4hpj/handsontable-roadmap-2016-login-to-vote-for-features |
@AMBudnik thanks! |
Couldn't we have a But we would need to get a callback event when we open the filter, so we can update the data accordingly. |
@AMBudnik is this still planed or under investigation ? as pagination is very important when one has many data, it breaks the purpose of the script until this is fixed :( thanks for any update ! |
hi @hycday |
hi @AMBudnik ! for example, on the link you just shared, if filtering is added, and user filters column A to filter by value "1", results will only show 4 lines in page 1 (and page 2-3-4-5-etc are wrongly filtered), whereas it should show 18 rows (in 3 pages, since its 6 rows per page). so is there a way of having the filtering with pagination working like described above, i.e. on all data, and not only the page displayed. |
With the current pagination demo structure there is no way to display result of filtering or sorting for whole data set. You will always get a result for a single page. You would need to perform sorting or filtering server side and on the whole data set to get this working. |
I completely agree with @hycday. If we could have a method to override how the sorting by value works, it would fix the issue. |
Indeed, a method to override the sorting function where i can do my REST call with the sorting parameters would also fix my issue. |
I am also in need of what @marc-antoinepelletier has been asking for. Is there any workaround to populate the filter dropdowns with our own values? If there is a function which can accept a datasource to re-populate the filter values in the dropdown when the pagination is involved that would be great. I need the filter menus to get their values populated from the whole dataset but not from only the current page dataset values. Please get back with an API or event that I can make use of. |
I found the event beforeColumnSort which is exactly what I'm looking for. There I build the url for the REST call with sorting parameters and reload the data. I hope that helps anyone of you, too. |
@dtslvr |
well this is exactly the issue that I am trying to point : in your jsfiddle, if on column A, you filter by value "1", the table displays 4 rows on page 1, but then shows 4 rows with value 0 on page 2 etc...so filtering is not correct with pagination. whereas it should : and let's say for example that one of the rows on page 4, column A has value "3", then filtering should also show "3" as an option of filtering, even if we are on page 1. |
@hycday |
@AMBudnik The filtering is a plugin (https://docs.handsontable.com/pro/1.8.2/demo-filtering.html) as far as I could see, but then it's in the pro version, is there a way to look at the source anyhow ? to be able to override part of the code to make it work for our need ? I've done that with the undoRedo plugin using this link http://docs.handsontable.com/0.29.2/plugins_undoRedo_undoRedo.js.html, I was able to change some behaviour of a specific method to make it work for me. Any chance we can do the same with the filtering ? so we can override it ? |
Hi @marc-antoinepelletier |
Thank you very much for all the propositions and opinions. I am moving this feature request to our wiki section > feature requests. |
Hi @AMBudnik Any Updates on this topic. I need this feature like when user will sort the data, then sorting should work on all page. For example, Suppose if I sort data "empcode " on my page the first page contain data like 1,2,3 records and on the 2nd-page 4,5,6 records are present. when user will sort the at that time the last record i.e empcode 6 should come on the first page and empcode 1 should go on the last page. Is this possible? |
Hey @Sheetal1289 if you do not have many rows of data (of heavy condition logic) you can use |
Hi. Closed issues rarely get new comments, so I hope that this issue will get more attention as a discussion. See you there for updates and new ideas. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hi.
I saw pagination demo: http://docs.handsontable.com/0.18.0/demo-pagination.html and I have added sorting to it, but when I click on header then sorting is applied only for data currently displayed.
Is there a possibility to sort whole data when I use pagination? I need some demo or clue.
The text was updated successfully, but these errors were encountered: