Sorting doesn't work on grouped rows
See original GitHub issue[ X] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
**Current behavior**
When selecting a column to sort on a grouped table nothing happens
ie. in demo page http://swimlane.github.io/ngx-datatable/#
Gender (sort desc) -> data doesn't change
Gender (sort asc) -> data doesn't change
**Expected behavior**
When selecting a column to sort on data inside group sorted
ie. in demo page http://swimlane.github.io/ngx-datatable/#
Gender (sort desc) -> data in group should be ordered Female, Female, Male, Male,
Gender (sort asc) -> data doesn't change Male, Male, Female, Female
**Reproduction of the problem**
click on column sorting observe data in group
**What is the motivation / use case for changing the behavior?**
sorting consistency and expected behavior
**Please tell us about your environment:**
N/A
* **Table version:** 0.8.x
N/A
* **Angular version:** 2.0.x
N/A
* **Browser:**
Chrome
* **Language:**
all
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:7
Top Results From Across the Web
sort grouped rows in excel - Microsoft Community
If you want to group rows in a sort you have to use a helper column which defines which row belongs to which...
Read more >How do I group rows in a spreadsheet and keep them together ...
First sort your data in descending order so that the item row is below the ingredients that belong to it. Group your ingredient...
Read more >Sub-groups not sorting with grouped row - Mr. Excel
I have been doing that and some groups move with the assigned groups and some don't. The majority of the time the grouped/collapsed...
Read more >How to Sort in Excel Rows or Columns Avoid Sort Problems
If there is a blank row or blank column in the data, part of the data might be sorted, while other data is...
Read more >How to sort grouped rows and columns? - Google Support
Select columns A through D. Then menu Data => Sort Range, column A is preselected. Add another sort column. B is preselected. Choose...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Still a problem with grouped sorting. doesn’t work.
You can react to the
(sort)
event on the table and sort the grouped entries yourself.BUT
For some reason, the sorting is not always using the order that is put in. If the input values for
[rows]
and[groupedRows]
change (due to some filtering), some positions of rows seem to be cached and they are placed seemingly at random.For example:
[rows]
and[groupedRows]
, change the sorting - the elements have order 2, 1, 0 but they are rendered in order of 1, 0, 2It’s often the first row that gets moved to the bottom, not always though. I haven’t figured out a clear “rule” or reason behind this mismatch of element-order and render-order.