Datagrid: speed question related to how it is working under the hood?

David Bovill david at architex.tv
Mon Sep 21 08:37:18 EDT 2009


I've got a question about how commands like "set the dgDataOfIndex" work
under the hood, and whether there are occasions where you would get speed
increases by directly setting the value of an individual control in a record
view.

*First an introduction:*
I've got a datagrid form I'm working on in which the data that makes up the
individual form contents comes from a variety of web services - consequently
the basic data comes over fast but the detailed contents (things like images
and metadata) comes over much more slowly.

The solution I'm trying to reimplement is based on asynchronously loading
the additional data using "load url with message". I can then display the
datagrid fast, and with a toggle arrow allow the user to reveal the image
and metadata when needed. If the metadata is still loading then I want to
display some suitable dummy "is loading" content.

The issue here is that if a hundred or more records are loaded into a
datagrid, then we will have several hundred asynchronous loads being fired
off and coming in all trying to update / redraw the datagrid one at a time.
Naturally this will need the fastest possible technique for updating the
display of the metadata - but we (probably) want to do this as the data
comes in.

*The questions:*
If I uses "set the dgDataOfIndex" to update the display of an individual
datagrid form record, does the underlying library only update the display
associated with this one record, or does the library redraw all the
currently displayed records?
Would I be any better off speed wise directly setting the images / metadata
of records using over using built in datagrid api calls?



More information about the Use-livecode mailing list