Dojo Enhanced Grid Sort on Selection

554
1
12-01-2019 07:16 PM
HenryKo2
Occasional Contributor

Hi, I have an Enhanced Grid with the Indirect Selecion plugin, so the users can select and deselect rows with checkboxes. My question is, is there a way I can make the grid to sort on the selection?

In the image above I can sort on the column "crash ID". But is there a way I can click on the header (i.e. where the red question mark is) so that I can sort by checkboxes/selections?

My grid creation code is as follows:

                this.resultsGrid = new EnhancedGrid({
                    style: 'height: 100%; width: 100%',
                    id: 'resultsGrid',
                    structure: layout,
                    plugins: {indirectSelection: {headerSelector:truewidth:"100px"styles:"text-align: center;"}},
                    rowSelector: '20px',
                    keepSelection: true
                });
0 Kudos
1 Reply
HenryKo2
Occasional Contributor

One way I can think of is create another column called "sorted", which can only be yes/true or no/false. This is a dynamic column, so when user checks a checkbox, this column will be immediately updated. Users can then sort on this column.

However I'd prefer something out-of-box and this introduces an extra column which can be strange for the users.

0 Kudos