How to do dynamic sort with a button instead of clicking the title of the column

Hi. I'm using OS11 with traditional web
I'm trying to do the dynamic sort for a list of records. But instead of clicking the title of the column to do the ASC/DESC sort, i want to click a button or an icon. maybe like the one that attached bellow. Can i do it, and how?

thanks!

Minh Tran wrote:

Hi. I'm using OS11 with traditional web
I'm trying to do the dynamic sort for a list of records. But instead of clicking the title of the column to do the ASC/DESC sort, i want to click a button or an icon. maybe like the one that attached bellow. Can i do it, and how?

thanks!

Hi Minh,

You can use listSort from the Logic Tab on your button click event. 

And can give the value of Ascending True or False.

Regards,


Solution

Hi,

Depend of what you want, you can do it, with one of this two ways:

  • 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]")
  • 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


I hope this help you,

Nuno Verdasca

Solution

Nuno Miguel Verdasca wrote:

Hi,

Depend of what you want, you can do it, with one of this two ways:

  • 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]")
  • 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


I hope this help you,

Nuno Verdasca

this solved my problem. thank you very much! 


Mohammad Hasib wrote:

Minh Tran wrote:

Hi. I'm using OS11 with traditional web
I'm trying to do the dynamic sort for a list of records. But instead of clicking the title of the column to do the ASC/DESC sort, i want to click a button or an icon. maybe like the one that attached bellow. Can i do it, and how?

thanks!

Hi Minh,

You can use listSort from the Logic Tab on your button click event. 

And can give the value of Ascending True or False.

Regards,


thnak you a lot, your solution also works.