| Summary: | Unable to sort non-moveable columns | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Peer Törngren <mbr-eclipse> |
| Component: | Nebula | Assignee: | Thomas Schindl <tom.schindl> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | apeeters, deryck, laurent.caron, tom.schindl |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
You are right this makes no sense so I removed the code and released the change Build Identifier 20120319-1429 It would appear that this fix has had the side-effect of breaking column selection when in cell selection mode. With no reference to cellSelectionEnabled in Grid.handleColumnHeaderPush, this method now always consumes the mouse down, and so control never passes to the later code in Grid.onMouseDown that deals with column selection, namely: 6841: else if (cellSelectionEnabled && e.button == 1&& columnHeadersVisible && e.y <= headerHeight) ... As per other discussions, selection events should not be fired when in cell selection mode and the cell header is clicked. looks like this introduce a regresion I created a naive fix for the regression in https://github.com/apeeters/nebula/tree/fix_column_selection It utilizes GridColumn.getSort() to determine whether column sorting is enabled. Not reproductible today, I suppose it has been fixed |
Build Identifier: 20100617-1415 Due to what appears to be a bug (or at least counter-intuitive behavior) in the Grid, the column must be moveable in order to be sortable. This appears to be because the code in 'Grid.handleColumnHeaderPush(int, int)' explicitly checks if the column is movable, and bails out to disable "column header push" behavior if it isn't. Hence, no "selection events" are sent unless the column is movable. This makes sense in order to disable "push" for moving, but it also disables sorting. The same (false) assumption is made elsewhere; a non-movable grid column is rendered flat to indicate that it cannot be pushed - but you may still want to push it in order to sort it. This is the actual code in 'Grid.handleColumnHeaderPush(int, int)': if (cellSelectionEnabled && overThis.getMoveable() == false) { return false; } Reproducible: Always Steps to Reproduce: 1. Create a default grid 2. Make the columns non-movable (setMoveable(false)) 3. Add a SelectionListener to the column, have it print all events on System out 4. Run the grid and click the column - no events are printed 5. column.setMoveable(true) 6. Run the grid and click the column - events are printed