Debugging DataGrid script

Trevor DeVore lists at mangomultimedia.com
Mon Jun 22 22:27:33 EDT 2009


On Jun 22, 2009, at 8:14 PM, mfstuart wrote:

> I originally got that script line from Trevor's web site.
> I tried it with the [] brackets, both with space and no space.
> I tried it without the [] bracket value.
> All 3 ways the script stops running at this line, with no returned  
> error.

Your syntax is fine. Spaces around brackets won't affect the parsing  
and since firstLineContainsHeaders is a variable it shouldn't have  
quotes around it.

> Trevor, anyway to find out what's going on setting a DataGrid NOT  
> from the
> place where the DG object is and this error?

A data grid table won't work so well if you try to work with it on  
cards that aren't open. The data grid table tries to access the  
formattedHeight property of fields  when working with the header. This  
property always always return 0 if the card isn't open.

In addition if you dig around in the code you would find that some  
control references are stored with the card/stack references stripped.  
This is probably causing the immediate error. It is easy enough to  
update the data grid to resolve the cached control references but I'm  
not sure about addressing the formattedHeight issue. I will have to  
investigate.

Regards,

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



More information about the use-livecode mailing list