swimlane / ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular
http://swimlane.github.io/ngx-datatable/
MIT License
4.63k stars 1.68k forks source link

Sorting works differently each time #819

Open NivedhithaV opened 7 years ago

NivedhithaV commented 7 years ago

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 works differently each time

Expected behavior

Reproduction of the problem Can be seen in demo - http://swimlane.github.io/ngx-datatable/#client-sorting Sample gif - https://gist.githubusercontent.com/NivedhithaV/d8b0a44961cf5b6611cbbeda161d335d/raw/d8aac582de49839a9c2ec45af6f8aaac4865f31c/swimlane.gif

What is the motivation / use case for changing the behavior? Better user experience

Please tell us about your environment: N/A

dannyvenier commented 7 years ago

the demo you refer to uses "multi" mode sort. (see below) I think if you use the default "single" mode sort it will behave with typical sort behaviour like you expect (clicking on second column header removes first selection).

I'm not sure I understand how or where multi mode sorting is used....

NivedhithaV commented 7 years ago

I'm not sure about the demo but I'm seeing similar issues in my app where I have the sortType set to single'

dannyvenier commented 7 years ago

Okay. I was just looking at the demo that you pointed to for reproducing. You can easily fork one of the plunkers from other issues to demonstrate your particular problem without too much mucking around in plunker. My app seems to sort as expected in single mode but I have not tested thoroughly. I don't understand the purpose of multi unless perhaps there is grouping on the rows. There are a bunch of issues that relate to "refreshing" of the lists' source and the view not updating but those are ones where the list changes, not sorting.