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

Clean up UI around multiple default sortDirection options #605

Closed
gabrielliwerant opened this issue May 10, 2019 · 3 comments
Closed

Clean up UI around multiple default sortDirection options #605

gabrielliwerant opened this issue May 10, 2019 · 3 comments

Comments

@gabrielliwerant
Copy link
Collaborator

The sortDirection behavior only affects the final column sorted, as multiple columns cannot be sorted simultaneously, since this would require reordering individual cell data among rows, thus scrambling the table data. However, it is unclear what is happening from a UI perspective, as it shows both arrows.

What should probably occur is that only the final arrow should show, and there should be a console warning that multiple columns have been set to be sorted.

@patorjk
Copy link
Collaborator

patorjk commented Jun 18, 2019

The jQuery Datatables handles this by having an order property in the table that's an array:

https://datatables.net/reference/option/order

The table allows you to select multiple columns by holding Shift and clicking the column. It's pretty useful. Example use case: Sort a table by the Last Name column, and then secondary sort on the First Name column.

@gabrielliwerant
Copy link
Collaborator Author

Hm, not sure I understand how a secondary sort would work since it must necessarily change the sort order from the first time around. The only time I can think of where it would matter is if there are multiple entries that are the same on the initial sort. But I'm not sure how to make it clear which sort direction should receive priority. If you can think of a decent API and UX for that feel free to open a new issue with a detailed explanation, and it can be treated as a new feature. This issue is specifically to solve some confusing UI around the current functionality.

@gabrielliwerant
Copy link
Collaborator Author

Should be resolved in 2.8.0.

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

No branches or pull requests

2 participants