ngx-datatable icon indicating copy to clipboard operation
ngx-datatable copied to clipboard

Sorting has no effect when used with row grouping

Open idpaterson opened this issue 8 years ago • 2 comments

I'm submitting a ... (check one with "x")

[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 Sorting specified with the sorts input or modified by clicking a column header is ignored when using groupRowsBy.

I attempted a workaround to null out groupRowsBy but while the group headers went away it did not fix the sort. In my case, it is possible to pre-sort the data before providing to rows so that groups are displayed in the correct order.

Expected behavior Sorting should do something though the exact behavior requires discussion. I expected sorts to affect the order of groups and rows within those groups such that a primary sort on the group and secondary sort on the items in the group would result in sorted groups containing sorted items.

However, I don't have a clear expectation for further sorting by the user. In my case it would be appropriate to either remove the groups once sorted on a different column, or maintain the group order but apply the selected sort within each group.

Reproduction of the problem The Row Grouping example exhibits this behavior; clicking a column does not affect the data, it just re-expands all groups.

groupsort

What is the motivation / use case for changing the behavior? It seems that all other features support sorting, so I chose to classify this as a bug.

Please tell us about your environment: macOS, Atom, npm 5

  • Table version: 10.3.0
  • Angular version: Angular 4.0.3
  • Browser: all
  • Language: TypeScript 2.4 (required for ngx-datatable 10 and doesn't seem to break our Angular 4)

idpaterson avatar Oct 19 '17 20:10 idpaterson