Work With - Orders

The order in which the tuples are displayed in a GeneXus grid can be customized using the Order property, in Ignia Framework the functionality related to this property is applied and the user can specify from the pattern instance two types of order, Simple Order and Multiple Order

Simple Order

The simple order is the one generated by default by GeneXus when the grid's Sortable property is activated, in this case it is allowed to sort the columns of a grid, one at a time, ascending or descending. This type of order is activated in the default pattern and is the one that is initially displayed when the objects are generated. 

 

Multiple Order


Multiple order allows a user to sort through multiple columns at once and save this selection in section. 

To activate this type of order in the pattern instance, the user has the Multiple Ordering property available in the Selection node of the WW.  

 

In the Max Columns Orders property, the user can configure the maximum number of columns for which they want to order simultaneously. For a configuration topic allowed in GeneXus, the maximum possible value for this field is currently 3 columns.  


 

After the multiple order has been activated, the user must select the columns that he wants to order, for which the Show in Grid Orders property is available in the attributes of the Selection node. 


 

To see an example, the Name, Phone, Address, Birth Date columns are selected so that they are present in the order and GeneXus is executed to see the result.

In the following image you can see that a new icon is added to the selected columns,  this icon tells the user that he can make an order for those columns and that currently the columns are not sorted. 


 

A column can have several states of order, not ordered, ascending, or descending orderly. The user can change the state by clicking on a column. 

Next, an example of  how a multiple order would look like: 

  • Sort by Birth Date in descending order and if there are the same date, sort by Name de in descending order. 


 

The figure shows how the grid records were sorted in a descending order by Birth Date in the rows selected in the red box as the dates were equal then they were sorted in descending order by the Name

It is also possible to see how the icon of the Phone and Address columns are marked with a different color, this means that they are disabled, because the Max Columns Orders property was set to 2. 

Releated pages: