[datagrid] how to search and show the result?

zryip theSlug zryip.theslug at gmail.com
Mon Aug 23 13:26:51 CDT 2010


On Sun, Aug 22, 2010 at 11:16 PM, Robert Mann <rman at free.fr> wrote:
>
> http://runtime-revolution.278305.n4.nabble.com/file/n2334409/testing_datagrid_search.rev
> testing_datagrid_search.rev
>
> An example is worth a thousand words...

Okay, now I see.

> In all fields, the found chunk when not actualy visible, is brought into
> focus by the find comand, except for datagrid, although it works with
> datagrids for occurences which are visible.
>
> This is understandable given how dataGrid works only building fields for the
> visible part of the table.

It's a problem relatives to groups, not only to the datagrid object.
Try to create three fields and group them. Set a vertical scrollbar to
the group and change the rect of your group to have two lines visible
and the last one only visible if you scroll. Type some text in each
fields, then try to execute the find command.

As a datagrid is in fact a group of controls and fields, the problem
is the same than with a simple group of a few fields.

> So as it stands, if there is a datagrid on a stack and if one wants to
> implement a search that searches everywhere, the standard find command must
> be doubled by a dataGrid related dgFind which is not trivial to do since the
> existing findline command reports only the first occurence.

Personally I never considered a datagrid as simple text container.
For me a datagrid is a container for rows or for records and when I
search in a datagrid, I'm waiting to have an entire record as result.

I can't speak for Trevor, but I think he has built the datagrid object
like that.

> With your findline command that reports multiple occurences, it remains to
> implement the actual find in datagrid which will show the found chunk ; and
> finally combine both standard find and dgFInd into a single findAll command!

It possible to jump to a line with two available commands in the
datagrid engine (one for lines, the other for indexes)
For now I'm not see how to scroll and "box" a string in a visible line
from the outside of a datagrid.
It probably possible in a custom behavior.
As far I have time and most of all an idea, I will give this a try.

> So I filed a request for an update of the find command, that really should
> work on all GUI elements for simplicity and coherence. In practice I beleive
> we'll have to sort out some sort of workaround once more, blessing your
> coming dg helper library!

I planned to come with the DGH library after the release of the DGH
plugin. In which form, I don't know. In my mind I not integrated it as
a plugin feature. I just uploaded the possible help stack of this not
ready library, because I thought it was near of your need.


Regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc



More information about the use-livecode mailing list