Basic Customization > User Interface Customization > Presenting Information in the UI > Constructing and Rendering a Table Using the JSP Framework > Customization Points > Setting Sortable Columns
  
Setting Sortable Columns
Sorting Behavior
Table is sorted at client side in following scenarios:
1. It is an asynchronous datasource enabled table and application team has not specified ‘preSorted’ property in result processor from builder to true.
2. If user explicitly changes the sort criteria and user revisits the table. (Sort stickiness).
Table is not sorted at client side in following scenarios:
1. If the application team set ‘preSorted’ property to true on the result processor of table builder.
2. In case of synchronous datasource enabled table.
During client side sorting, when the data chunk come to the client, they are added to the store as per the client sort criteria.
If the user clicks sort while the data is loading, the data gets sorted at client side. Also the data chunks that come later are also added in sorted order.
Multi-column sorting: Multiclick to sort feature allows the user to sort multiple columns at a time there by pressing the shift key and then sorting. The limitation is maximum three columns are allowed to sort at a time.
In case of sorting on version column, sorting happens at server side.
Setting Default Sort
A table column can be as a default sort column by using setDefaultSort(true) for the column. For setting the direction setAscending() can be provided with value ‘true’ for ascending sort and ‘false’ for descending sort.
ColumnConfig col = factory.newColumnConfig(“name”, true);
col.setDefaultSort(true);
col.setAscending(false);
Configuring the column as above in table builder will cause a table to be displayed as: