Datagrid sorting

Marcello Bertoli mbertoli at libero.it
Mon Apr 26 07:15:58 EDT 2010


On 23/apr/2010, at 21.46, Andre.Bisseret wrote:

> Actually, to do a multi-criteria sorting (here two criteria) one must sort firstly by the second criteria, then by the first one. So that one gets the names in alphabetical order inside each date. So a mixt of my two proposal seems to do the trick ( In fact it suffices to inverse the order of the two "dispatch" lines in the last script I send you (as they were in the first proposal); 

Thanks Andre,

your code seems to do the trick! I tried also with 3 criteria.


> [...]
>      if theColumn is "date" then
>         dispatch "sortByColumn" to the target with "name" ## second criterium
>         --wait 1 sec
>         dispatch "sortByColumn" to the target with "date" ## first criterium
>      end if
>   end if
> end mouseDown


Actually I don't understand one thing: the "wait 1 second" statement. If I leave this statement commented the code doesn't work. If I activate it, everythings works... Can you explain me what the wait does in this particular scenario?

Best Regards
Marcello


More information about the Use-livecode mailing list