Datagrids and the native find command

zryip theSlug zryip.theslug at
Sun Sep 19 17:20:20 EDT 2010

On Sun, Sep 19, 2010 at 11:45 AM, Robert Mann <rman at> wrote:
> .. and as you mention such a datagrid dataObject should allow the standard
> find to find it's elements.. or provide an extended find function, like the
> one I put up on revOnline (which only works for datagrids with cached mode
> turned on).
> The way datagrids are being used is interesting.
> 1) datagrids are the most tangible evolution of the runrev IDE and that was
> needed to stay in touch with what other "modern" languages are providing
> THis evolution started with the more frequent usage of properties as data
> containers.... away from the hypercard metaphore (all the data is in fields
> within cards and "find" finds it all..).
> 2) it is a big step AWAY from the hypercard metaphore, because for the first
> time... the find does not work anymore on data that is created using a
> standard object palette.. whouaouu... that is biiiigg!


What is great with Revolution is that you or me can easily create our
own objects. A foreign object.

The datagrid is one of them. An object built for a specific need:
displaying records. With the datagrid you can display 5, 10 or 100
records. But you might well imagine have a list of 20000 or 50000
However the data send to the datagrid object is not resident in the
fields you can seen by scrolling the list. It resident in a variable,
more exactly in a multidimensional array. All you can see in the
screen is built on the fly and filled by the FillinData handler of the
datagrid. With the minimun cost of objects. 8-)
The (50000 * the number of columns fields) are not really created in
the datagrid, only if you turn the cache to on, but for this amount of
records, it would not adviced. ;)

That is a quote of the datagrid documentation concerning the cache controls:

cache controls
- By default the data grid only draws the controls that are visible on
the screen. In circumstances where you don't have large amounts of
records but the records you have take a long time to draw you may
cache all of the controls when the data grid is drawn. This takes a
little longer to display at the beginning but will offer smooth
scrolling when the user interacts with the data grid.

So that's why when you turn the cache control to on, you are able to
use the find command in it. That is the only way to have the native
find command performs.

A possible workaround for simulating the find command in a datagrid
with a cache control turn to off could consist to select the content
of the field when it is drawn on the screen.
In a custom behavior, you can for example search the text with the
offset function and "boxed" in HTML.

Do you see now why the find command not working with datagrids? Simply
because the datagrid contains only the text display in the screen.

-Zryip TheSlug- wish you the best! 8)

More information about the Use-livecode mailing list