The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Sort by more than one column at once
Posted: 11 Jun 07 9:34 PM
|
We just upgraded to SLX v7 from v5.2. Our software developers used to be able to sort a list view in the defect module of support client by more than one column at once by SHIFT-Clicking the columns.
In the SLX v7 Client, this does not work. Has anybody found this functionality? |
|
|
|
Re: Sort by more than one column at once
Posted: 11 Jun 07 11:05 PM
|
The standard SLX datagrid does not provide this ootb. One possible workaround is to add 'sort by' buttons which modify the grid's underlying SQL. Or maybe use a 3rd party datagrid. |
|
|
|
Re: Sort by more than one column at once
Posted: 12 Jun 07 7:03 AM
|
For what it's worth... (in 6.2.x - haven't seen 7.x). It APPEARS as if you can do this in the SQL property of the datagrid, but unfortunately many of the properties in the SQL property are trumped by the Columns properties (visible being the most frustrating). And in this case, the 'sorting' in the SQL property just doesn't do anything you expect it too.
Anyway - what Phil said is an answer. Alternatives (in Code) are to get the datagrid.SQL.Text and append an “Order By” statement (look at the SQL first to get the aliasing right and make sure there isn’t already an order by there).
|
|
|
| |
|
Re: Sort by more than one column at once
Posted: 13 Jun 07 1:50 PM
|
One thing not mentioned (and in as early as 6.1 I think) is the GroupPanel property of the grid. This allows users to drag columns and create sort chains. Furthermore, you can use this programmatically by setting a Grid.Column.Group index (0 based) and create your sort chains programmatically.
When we upgraded from 5.2 to 6.1, I used this to prevent the Sortable = true "load entire recordset into memory". While this is generally never a problem because tables are small, it can easily become a hassle for large tables and to my knowledge this is the only method to work around the problem.
In addition to that, I found that in v7 SP1 when sortable = true the grid won't automatically jump or select the first record. This is present in the default Attachments grids as the date selection is sorted but it'll automatically scroll to the bottom, most likely because the sort isn't applied until last instead of at the SQL level. GroupPanel would most likely solve the problem a little easier than finding the first record in the recordset and re-selecting it manually (which apparently I got wrong). |
|
|
|
Re: Sort by more than one column at once
Posted: 15 Jun 07 9:06 AM
|
It's been gone since 6.x and the new grids (and all their incarnations/versions).
Multiple choice picklist control with the field names in it? On Popup Control parse out the selected column headers.....nope, can't specify order.
How about a list of fields, with an edit box next to it to specify sort order.....blank or zero ignore. Ties, simply go with the control order.
Then when you fire off a refresh you can either redo the SQL.....or you can play with the column control itself.
Don't have the syntax in front of me, but it's like Ryan's build a grid dynamically stuff...
grdname.columnobject.Sort(1) sorts on the 2nd column.... .Group(1) sorts and Groups by the 2nd column (and displays the group in the header row, and the group caption in the Grid header).
then grdname.refresh
so ACCOUNT CONTACT COMPLETEDDATE STATE USERNAME 1 <> -2 0 3 aND THEN HAVE A refRESH button.
I don't know how to do descending sorts without using SQL....
|
|
|
|