Page 1 of 1

Sorting Grid on 2 columns at once or quickier ?

Posted: Thu Jan 18, 2018 8:44 pm
by teriibi
Hi,

Im using this syntax who does the Job so as to sort my Grid
1) By continent and
2) Sort country A/Z within each continent.

Is there any better (1 line?) syntax to achieve the same ?
or
some code that would be faster in case of some very very long list..
as if I added all States Names (worldwide)
:?:
(number of countries wont change much) :)

Code: Select all

on mouseup
   set the dgProps["sort by column"] of group "DGLands" to "CName"
   set the dgProps["sort by column"] of group "DGLands" to "Continent"
end mouseup
Thanks ! :arrow:
:roll:

Re: Sorting Grid on 2 columns at once or quickier ?

Posted: Thu Jan 18, 2018 9:21 pm
by quailcreek
This is another way, which I think is faster. I do not believe you can do a simultaneous double sort.

Code: Select all

dispatch "SortDataByKey" to grp "DGLands" with "CName", "text", "ascending", "true"
send "RefreshList" to grp "DGLands"

Re: Sorting Grid on 2 columns at once or quickier ?

Posted: Thu Jan 18, 2018 9:32 pm
by teriibi
Cool, thanks !
Actualy much better since I can specify the order ! :idea: