Record List Ordering

Record List Ordering

  

HI, 

I wanted to order a Record List. My solution to this is to have a couple of links on the top. when i click this links i go to an action where i sort the records with SortRecordList. For each link i need to have a variable to inform if is asc or desc. There is a better way of doing this? you have an example? the support page is a good example of what i'm trying to implement https://www.outsystems.com/SupportPortal/Support/

Best regards,

Marcelo

Hi Marcelo, 

If you provide more information that would be helpful. What links are you talking about? 

Heya,


did you check out scaffolding an entity?

This will produce a list-screen with sorting.

http://labs.outsystems.net/londontheme/Scaffolding.aspx

Hi,

I don't want to use a table record. I want to use a List Records.

It would be links I would create, one for each column of the table I want to order by. 

You can check https://www.outsystems.com/SupportPortal/Support/ to see the kind of list and ordering I want to achieve.

Regards,

Marcelo

I was suggestinging to look at those scaffolded how they have used the sorting

In any case you have also listsort and then its just having a screenaction to sort as you like.

Simply have an if inside the listrecords for example to add the header when rownumber = 0.

Be creative :)



Hello Marcelo,

Do you need something like I have here (both screens have List Records), or do you want the functionality of being able to sort, dynamically, by more than one column, like in the Support page?

Cheers,
Eduardo Jauch

Marcelo Ferreira wrote:

For each link i need to have a variable to inform if is asc or desc. There is a better way of doing this?

Well, that depends on your definition of "better". The RichWidgets eSpace uses a single session variable to store all the sorting options in some serialized fashion I think (iirc eSpace Id, TableRecords widget id, column id or the like), which you could do as well, or otherwise indeed have seperate variables.


Hi,

@Eduardo to be honest i didn't think about sort by more than 1 column, it would be nice but your example is good enough. Can you share your solution?

@Kilian thx I will check how RichWidgets does it.

Regards,

Marcelo

Hi Marcelo,

Yes, I can share.In fact, I am preparing a component to send to the forge. If you give me a couple days, It will be ready.

I based it in the Sort Column of the RichWidgets.

Cheers,
Eduardo Jauch

Hi,

Yes I was checking RichWidgets and you only need to change a line on List_SortColumn

SyntaxEditor Code Snippet

var tableRecordsId = $('#' + linkId).parents('table.TableRecords:eq(0)').attr('id');

And this way you can have a ListRcord_SortColumn.

I think i will try to do it be myself. But when you finish, if you remember, post here the link of your component so everyone can check it.

Regards,

Marcelo


Hi,

My solution to sort RecordList columns:

https://www.outsystems.com/forge/component/2526/recordlist-sortcolumn/

Cheers,

Marcelo

Thanks Marcelo for this component and cheers for you!!