List View Sort

Christie Widget Designer Version 6 - Q&A

Moderator: Moderator Group

Forum rules
When asking make sure to include the operating system and the revision of Widget Designer you are using.

List View Sort

Postby ingibekk » Thu Apr 13, 2017 1:52 pm

Hello there,

does someone have a script available that sorts a list view in a specific order based on values in a specific column ?

Similar to what you do in every other spreadsheet application.

Cheers,
IB
ingibekk
 
Posts: 18
Joined: Thu Feb 21, 2013 11:58 pm

Re: List View Sort

Postby Janina Baltaziewicz » Thu Apr 20, 2017 1:07 pm

Hi IB,

That's indeed a tough one.
I don't have a script ready, but I think it should work when you load all cell values of the respective column into a list variable with "VGetListViewCell" and a for-loop, and sort this one with "VArraySort".
You could then use one of the "VGetListViewSearch..." commands to retrieve all values of the whole row and set those values again to the correct cells (where the row number would be the index of the item in the sorted list) with "WDListViewSetCell".

I think the best workflow would be to sort the column values, then read out each row and buffer the cell values in list variables, and finally overwrite the ListView rows according to the new sorting.
Depending on your setup, this might even be possible by using only local variables.


Does this approach help you?

Cheers,

Janina
Janina Baltaziewicz
Technical Support Technologist
User avatar
Janina Baltaziewicz
 
Posts: 31
Joined: Tue Jun 14, 2016 2:08 pm

Re: List View Sort

Postby ingibekk » Thu Apr 20, 2017 1:36 pm

Hi Janina,

thanks for the reply.

This could definitely work, it's a list with only 2 columns (Name and Score) where I need to sort by the lowest score.

I haven't used for loops a lot but I better give it a go, thanks for the tip!

Cheers,
Ingi Bekk
ingibekk
 
Posts: 18
Joined: Thu Feb 21, 2013 11:58 pm


Return to Widget Designer V6

Who is online

Users browsing this forum: No registered users and 1 guest