Feature #4008
closedQueryModel: Consider supporting a custom ORDER BY for sort()
0%
Description
The QueryModel sort() method currently provides for ascending or descending sorts on a single column, but in some cases it would be useful to be able to include additional fields in a sort, e.g. to break ties on the primary field.
The WSortFilterProxyModel is helpful, but in some cases it may be simpler and more efficient to handle sorting in the SQL query.
The QueryModel sort() method is virtual, however it accesses private members and does not appear to be designed for derived classes to override.
An attached patch, for your review, adds a new public method createOrderBy() that separates out the creation of the ORDER BY clause from the rest of the sort() logic. It should be backwards compatible and includes a test/example. The patch was tested with the github version of Wt, 3.3.3-48-g051edee (3.4.0+3?).
Files
Updated by Koen Deforche over 9 years ago
- Status changed from New to InProgress
- Assignee set to Benoit Daccache
Updated by Benoit Daccache over 9 years ago
- Status changed from InProgress to Resolved
Updated by Koen Deforche about 9 years ago
- Status changed from Resolved to Closed