Sorting columns dynamically by using ListSort

Sorting columns dynamically by using ListSort

  

Hi,

Actually, I am working sorting of multiple columns with ListSort by hard-coding the values by clicking on order by status and check-in date button in below image.

Is it possible to select the columns in run-time as below image

or else Is it possible by clicking columns in runtime and then selecting a  sort button in runtime.

Regards,

Trinusha

trinusha karumanchi wrote:

Hi,

Actually, I am working sorting of multiple columns with ListSort by hard-coding the values by clicking on order by status and check-in date button in below image.

Is it possible to select the columns in run-time as below image

or else Is it possible by clicking columns in runtime and then selecting a  sort button in runtime.

Regards,

Trinusha

Hi trinusha karumanchi

Add the List_SortColumn to the header of the column which you want to sort dynamically with the Column property is {Entity}.[Attribute] and the fire the Destination Action. Finally open the current screen preparation and add the dynamicSort 

SyntaxEditor Code Snippet

List_SortColumn_GetOrderBy(TableName.Id, "{Entity}.[Attribute]")



Hi trinusha karumanchi,

The List_SortColumn behaviour is, based on which column you click, use that column to sort the aggregate that feeds data to the TableRecords.

If you want the behaviour you are describing, you will have to build it by hand:

  • implement the multiple sort criteria UI;
  • build the dynamic sort string from the multiple sort criteria you defined in your UI;
  • pass the dynamic sort string to the aggregate that provides the DataSource Record List of the TableRecords;
  • Use Data Refresh to fetch a version (data) code;
  • Use Ajax Refresh to refresh the TableRecords

Jorge Martins wrote:

Hi trinusha karumanchi,

The List_SortColumn behaviour is, based on which column you click, use that column to sort the aggregate that feeds data to the TableRecords.

If you want the behaviour you are describing, you will have to build it by hand:

  • implement the multiple sort criteria UI;
  • build the dynamic sort string from the multiple sort criteria you defined in your UI;
  • pass the dynamic sort string to the aggregate that provides the DataSource Record List of the TableRecords;
  • Use Data Refresh to fetch a version (data) code;
  • Use Ajax Refresh to refresh the TableRecords

Hi Jorge,

Can you please explain in detail means can you suggest me a way to do multiple sort criteria in ui.

Regards,

Trinusha.


trinusha karumanchi wrote:

Jorge Martins wrote:

Hi trinusha karumanchi,

The List_SortColumn behaviour is, based on which column you click, use that column to sort the aggregate that feeds data to the TableRecords.

If you want the behaviour you are describing, you will have to build it by hand:

  • implement the multiple sort criteria UI;
  • build the dynamic sort string from the multiple sort criteria you defined in your UI;
  • pass the dynamic sort string to the aggregate that provides the DataSource Record List of the TableRecords;
  • Use Data Refresh to fetch a version (data) code;
  • Use Ajax Refresh to refresh the TableRecords

Hi Jorge,

Can you please explain in detail means can you suggest me a way to do multiple sort criteria in ui.

Regards,

Trinusha.


Hi trinusha karumanchi,

Here the steps to follows 

1.Drag the List_SortColumn into to the specific column need to sort.

2.click on the link Properties tab open on the right of the service studio. name the column as "{EntitiesName}.[ColumnAttributeName]" as shown. 



3.Click on On OnNotify Action Drag the Refresh Data and  and choose the datasource as Aggregate .

Drag the ajax refresh into it and name the widget container enclosed a table. 


4.Finally Go the preparation and click the aggregate table ,Click sorting, click Add dynamic sort and add 

SyntaxEditor Code Snippet

List_SortColumn_GetOrderBy(OrderTable.Id, "{Client}.[Name]")


Regard:s

Chetan

Sometimes if possible, just add a new attribute on the aggregate and then just sort by the new attrbute that can be a combination of other attributes values.