Skip to content
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 on column with same values reorders few rows #320

Closed
ghost opened this issue Apr 5, 2012 · 2 comments
Closed

Sorting on column with same values reorders few rows #320

ghost opened this issue Apr 5, 2012 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 5, 2012

I have modified the multi column sort example to reproduce this problem.
If you place this file in the 'examples' folder under zip, you can run it.
Link to file: http://www.2shared.com/complete/T62fpuNd/example-multi-column-sort.html

In this example, I have made sure that start & finish columns have identical values (dates in this case but problem is also reproducible with strings or numbers). If you click on start (or finish) column you will see that only rows with title (Task 0, Task 1 and Task 7) interchange positions.

The expected behavior is to not change the row order since all values in the column (start/finish) on which sort is applied are identical.

Love slickgrid,
Thanks.

@mleibman
Copy link
Owner

mleibman commented Apr 5, 2012

I'm guessing you're using Chrome, which, for some reason, doesn't implement stable sort. Technically, it's not part of the spec, but all other browsers do have a stable sort implementation. Either way, this is outside of the grid competency. In your "sort" event handler, you can sort using a custom sorter instead of the built-in Array.sort.

@ghost
Copy link
Author

ghost commented Apr 6, 2012

Yes you are right. It is a chrome bug. Thanks.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant