e: command setthedata in the data grid api

Trevor DeVore lists at mangomultimedia.com
Wed Apr 22 22:43:25 EDT 2009


On Apr 22, 2009, at 8:55 PM, Sadhu Nadesan wrote:

> Well, I can send you the whole stack, and some sample data and you  
> can see what else is going on!?!  But then I'd have to kill you.

We will do our best to avoid this. I still haven't been on my BBQ tour  
across the southern U.S. so I'm not ready to go yet.

> ...
>
> To assist the user in sorting through this data, I'd like a power  
> tool, a choice that removes all the lines in the grid that have only  
> valid data - only green cells - these cells also have had the token  
> "Verified" appended to them (as in the code snippet previously  
> sent).  Once distilled down to all errors, the user can manually  
> delete the insignificant errors, then go on to the next step of  
> creating a 'data to be corrected' report.

Since you have already marked each row in the data grid as verified or  
not you can loop through each index and delete as necessary. Here is  
an example handler that you could put in your data grid script. I  
don't know what the name of the key is that contains the "Verified"  
value but the code below should pretty much do what you want. Each  
time you call DeleteDataOfIndex the index is removed from the internal  
data grid array and the data grid will be updated visually if the  
index is being displayed on screen. Let me know if it works for you.

command FilterMe
     lock screen

    ## Loop through all indexes and remove those that are verified.
     repeat for each item theIndex in the dgIndexes of me
         if GetDataOfIndex(theIndex, "KEY_WITH_VERIFIED_VALUE") is  
"Verified" then
             DeleteIndex theIndex
         end if
     end repeat

     unlock screen
end FilterMe


Regards,

-- 
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com    -    www.screensteps.com



More information about the use-livecode mailing list