-
Notifications
You must be signed in to change notification settings - Fork 83
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
[grid] vaadin-grid-sorter feature request: bi-state sorting #2018
Comments
I think this would be a welcome enhancement. We chose to tri-state by default because it covers the broader use case. But I do understand that this depends on the desired UX for the app, and sometimes tri-state is not suitable. Did you already have an API in mind, how this would be configured? |
The following should also do the trick:
|
I tried that first but it sets every column to ascending when the elements
are created which should not be allowed to happen unless multisort is
turned on. In my scheme all columns start out null; once you sort one
column you cannot return to a no-sort state. My scheme may not even make
sense with multi-sort.
…On Mon, Oct 30, 2017 at 2:48 PM, Tomi Virkki ***@***.***> wrote:
The following should also do the trick:
grid.addEventListener('sorter-changed', e =>
e.target.direction = e.target.direction || 'asc');
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/vaadin/vaadin-grid/issues/1069#issuecomment-340546507>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATWIZOAUXiGIqDd-H2nUv-TSoBjY1akks5sxhoBgaJpZM4QLaLR>
.
--
73 de n1ywb
|
I should add that I had originally configured my table with multisort, but
like the tri-state, my UX folks asked me to turn it off, too complex for
our users, so we only use single-sort.
On Mon, Oct 30, 2017 at 9:56 PM, Jeff Laughlin <[email protected]>
wrote:
… I tried that first but it sets every column to ascending when the elements
are created which should not be allowed to happen unless multisort is
turned on. In my scheme all columns start out null; once you sort one
column you cannot return to a no-sort state. My scheme may not even make
sense with multi-sort.
On Mon, Oct 30, 2017 at 2:48 PM, Tomi Virkki ***@***.***>
wrote:
> The following should also do the trick:
>
> grid.addEventListener('sorter-changed', e =>
> e.target.direction = e.target.direction || 'asc');
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/vaadin/vaadin-grid/issues/1069#issuecomment-340546507>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AATWIZOAUXiGIqDd-H2nUv-TSoBjY1akks5sxhoBgaJpZM4QLaLR>
> .
>
--
73 de n1ywb
--
73 de n1ywb
|
You can ignore the initial
|
Upon further testing that solution still seems to force multisort. Previously sorter cols do not return to null sort state when a new column is sorted. |
Our UX designers identified the current tri-state sort behavior (asc, desc, null) as potentially confusing for users and asked me to make is so that once a column is clicked for sorting, clicking the sort button toggles between asc and desc. Clicking another column in single sort resets the first column to null sort. We do not use multi-sort.
This should be rather easily accomplished with the addition of a
bi-state
property and a slight change to https://github.com/vaadin/vaadin-grid/blob/master/vaadin-grid-sorter.html#L208If there's sufficient interest from Vaadin I can talk to my boss about getting that coded up. For now I have just monkeypatched the sorter in my app.
The text was updated successfully, but these errors were encountered: