[datagrid] how to search and show the result?

Trevor DeVore lists at mangomultimedia.com
Wed Jan 27 09:27:11 EST 2010


On Jan 26, 2010, at 10:56 PM, Robert Man wrote:

> I built a simple list using datagrids, all goes fine. I chose to  
> store data
> in the dg cache. Except, that in any text application, you'd expect  
> the find
> command to work and display the results.
>
> Currently, the standard IDE search finds a test word in the dg cache  
> of the
> datagrid. that's about it.
>
> If any of you has an idea on how to implement searching and showing  
> in a
> datagrid.. or maybe this issue will be covered in a later version of
> datagrids? thanks, Robert

Hi  Robert,

You can use FindIndex/FindLine for exact match searching:
<http://lessons.runrev.com/spaces/lessons/manuals/datagrid/lessons/7344-Data-Grid-API 
 >

An example:

dispatch "FindLine" to group "DataGrid" with "MyColumn", "String To  
Find"
put the result into theLine

For partial matches you have to write any search routines yourself.

If you are display data from a database then you would perform the  
search using SQL and then update the data in the Data Grid.

To search the Data Grid data you can extract the dgText/dgData,  
perform the find, determine which column and line/index the found  
result is located in  and then select it.

-- 
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com




More information about the use-livecode mailing list