Datagrids: unsorting data

Trevor DeVore lists at
Wed Apr 29 11:39:53 EDT 2009

On Apr 29, 2009, at 10:07 AM, Trevor DeVore wrote:

> Once you sort the data it is sorted everywhere though looking at the  
> code it appears that the persistent data is not updated after  
> sorting. This will be fixed in the next version but you could do  
> this to restore your previous sort:
> set the dgIndexes of group "DataGrid" to the dgCache["sequencing"]  
> of group "DataGrid"
> The property that actually changes internally is the dgIndexes of  
> the data grid. The dgIndexes contains a comma delimited list of the  
> internal array keys in the sorted order.

One problem with the code above: there is no setprop for dgIndexes in  
the version of the data grid you have. You can add the setprop to btn  
"data gird" of stack "revdatagridlibrary" though. Just find getprop  
dgIndexes in the script and add the ollowing after (just make sure you  
set the preservevariables to true beforehand so the script locals  
aren't wiped out).

setprop dgIndexes pIndexes
     put pIndexes into sIndexSequencing

     lock screen
     unlock screen
end dgIndexes


Trevor DeVore
Blue Mango Learning Systems    -

More information about the use-livecode mailing list