#7304 closed defect (fixed)
Selection doesn't follow row when sorting in DataGrid
Reported by: | Bryan Forbes | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | DojoX Grid | Version: | 1.1.1 |
Keywords: | Cc: | David Schwartz | |
Blocked By: | Blocking: |
Description
When sorting a column after selecting a row, the selection should follow the item selected rather than the row index in the grid.
Attachments (1)
Change History (27)
comment:1 Changed 12 years ago by
Milestone: | tbd → 1.3 |
---|
comment:2 Changed 12 years ago by
Owner: | changed from Bryan Forbes to Nathan Toone |
---|
comment:3 Changed 12 years ago by
Milestone: | 1.3 → future |
---|
comment:4 Changed 12 years ago by
Cc: | David Schwartz added |
---|
comment:5 Changed 12 years ago by
This bug also applies when selectionMode="multiple":
If you look at the grid Multiple in this test: http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_selection.html
then toggle a few rows and sort by column, the selected rows are now different rows (at the same positions that they were before).
comment:6 Changed 12 years ago by
Just to be clear, this issue exists whether the selectionMode is 'multiple', 'extended' or 'single'.
comment:8 Changed 11 years ago by
It's moderately difficult to fix - what would need to happen is we'd need to keep track of selection on a per-item basis...rather than a per-row basis (as we currently are).
Most of the issue is making sure that we don't break other stuff in making that change. Patches are welcome - but I just don't have cycles to dedicate to solving this in the week before 1.4 gets frozen.
comment:9 Changed 11 years ago by
The above patch might break the compat grid, due to the getFirstSelected/getNextSelected not doing anything useful anymore.
Changed 11 years ago by
Attachment: | Selection-identity-based added |
---|
Prevent selection from occuring when no item is available.
comment:11 Changed 11 years ago by
Above patch is still not usable due selection not working on rows that have not loaded their associated items from the store.
comment:12 Changed 11 years ago by
Identifier based selection management will not allow for virtualized selection (select all, or selecting an item and scrolling down and shift-selecting).
Alternative solution would be to deselect all selections when the filter or sort changes.
comment:13 Changed 11 years ago by
Yes - this is exactly the reason why I mentioned that it's moderately difficult to fix. Getting into the "guts" of the grid can be quite a pain at times...
comment:14 Changed 11 years ago by
I don't think this is an issue of difficulty, but rather an issue of capability. As far as I see it, there is no way to do identity based virtualized row selection management without the server participating in someway (full server side selection management, or row based identity querying interface), or by obtaining all item identifiers beforehand.
If anyone has a solution in mind that shows otherwise, please sketch it out.
comment:15 Changed 11 years ago by
My $.02: This is a serious usability bug. The user doesn't select 'row 5' but rather 'object XXXXX'. Selection should definitely persist across sort events. This will really tick users off when they discover that their selection is lost.
comment:16 Changed 11 years ago by
Agreed - this bug *needs* to be addressed...the issue is that it's not a simple enough bug to address in the 1.4 timeframe. Especially given that the issue has existed since the dawn of Grid-time. :)
comment:17 Changed 11 years ago by
The above patch does work except for virtual selections (the following scenarios):
- select all (with the _CheckBoxSelector)
- select item, scroll over unloaded pages (so it won't load them), shift select
So it should work for most cases, just not when selecting items that have not been loaded.
comment:19 Changed 11 years ago by
It will at least remain open until it's working in *some* cases... ;)
That is, I haven't applied the patch yet - I'll have to look at it and see what it would take to handle virtual selections. I'm guessing that virtual selections will not be able to be handled...because we don't *know* what items were selected (because they weren't loaded...we don't have their identity).
comment:21 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [25579]) Fixes #7304 !strict by leveraging selection persistence across DataGrid?, TreeGrid/LazyTreeGrid?. Refs #10855
The selection persistence feature is still limited with
- Key precondition - Store Identifier(id) is required since id is used for differentiating row items.
- Known issue - might not be accurate if some unloaded rows are selected by range(e.g.SHIFT + click)
Usage - To turn on this, please set 'keepSelection' attribute to true, e.g. <div dojoType="dojox.grid.DataGrid?" keepSelection = true .../> or
<div dojoType="dojox.grid.TreeGrid?" keepSelection = true .../> or <div dojoType="dojox.grid.LazyTreeGrid?" keepSelection = true .../>
comment:22 Changed 10 years ago by
Milestone: | future → 1.7 |
---|
comment:23 Changed 10 years ago by
comment:24 Changed 10 years ago by
(In [25668]) Refs #7304 leveraging selection preserver with LazyTreeGrid?, also see [25579]
Reassigning to me