Hi,

I have given a record list variable as a source record to the table i need to apply sort on click of each of the column how can i implement it.i am able to apply default sort using sortrecordlist but i need to implement sort onclick of each table attribute.

Thanks,

Ronan T.

Hi Ronan,


Please share oml to provide you exact answer . You can put link on header of table and on click to Ajax refresh of the query. Pass column name as parameter to query and use it in sort expression. 


Thanks 


Hi, 

Use the same pattern that is used in the Richwidget ListSortColumn. You can use even the widget itself. 

In the OnNotify action, instead of the data refresh you apply again the sort to the variable and refresh the table records. 

Beware that this will have a performance penalty, as the local variable, being used for anything else than just source will not be optimized.

Not sure if there is a workaround... 

Cheers

Eduardo Jauch wrote:

Hi, 

Use the same pattern that is used in the Richwidget ListSortColumn. You can use even the widget itself. 

In the OnNotify action, instead of the data refresh you apply again the sort to the variable and refresh the table records. 

Beware that this will have a performance penalty, as the local variable, being used for anything else than just source will not be optimized.

Not sure if there is a workaround... 

Cheers

Hi Eduardo Jauch ,

Records are sorting only when i click on the link and reload the page..but i need just on click of link records should get sort.


please find the attached file


Sorry,

But I am really not sure what do you mean.
In an assign, if you do:

1. Sort = something
2. Sort = another thing
3. Sort = something else

In the end, Sort will have "something else".

So, what are you trying to accomplish?
If you want to sort based on the click of the column in the table, the easiest way is like I told you before.

1. Do everything like if you had an aggregate, using the RichWidget. The changes are as following:
2. In the place of the name field in the widget, you use simply the attribute name.
3. in the sort action, you get this by using ListSortColumn_GetOrderBy.

I think this is the easiest way to do that.

Cheers.

Eduardo Jauch wrote:

Hi, 

Use the same pattern that is used in the Richwidget ListSortColumn. You can use even the widget itself. 

In the OnNotify action, instead of the data refresh you apply again the sort to the variable and refresh the table records. 

Beware that this will have a performance penalty, as the local variable, being used for anything else than just source will not be optimized.

Not sure if there is a workaround... 

Cheers

Hi,

Could you please explain,

Here i didn't understand what you mean by apply again the sort to the variable


The variable that holds the list. :)

Eduardo Jauch wrote:

The variable that holds the list. :)

 Hi,

apply again the sort to the variable ,here sort is type of text and variable is type of list.

So,we can not assign text to list.

please suggest me, where i am doing wrong

Hi Ronan, 

When I say "apply the sort to" I'm asking you to sort the list using the chosen criteria. 

Cheers