Re: [datagrid] how to search and show the result?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

Trevor DeVore
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

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

Robert Man
Thank you Trevor. I realized just after writing that there was a find function in your library.. so I deleted my post... but somehow it did not work ! Thanks again for your detailed answer and hope this can benefit to others too. Robert
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

Robert Mann
In reply to this post by Trevor DeVore
Trevor DeVore wrote
dispatch "FindLine" to group "DataGrid" with "MyColumn", "String To  
Find"
put the result into theLine
Coming back to it... ok this gives me the line, then I can scroll that line in view.

but when there are several occurences of the searchedString, the result outputs only the first line.

Is there a way to get all lines??? Thanks

[trying to implement a dgFind function that works like the runrev find (showing with a rectangle the foundChunk and bouncing to next occurence... ) if anybody has it already.. share it on revOnline please!]
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

zryip theSlug
On Sun, Aug 22, 2010 at 3:45 AM, Robert Mann <[hidden email]> wrote:

>
>
> Trevor DeVore wrote:
>>
>> dispatch "FindLine" to group "DataGrid" with "MyColumn", "String To
>> Find"
>> put the result into theLine
>>
>
> Coming back to it... ok this gives me the line, then I can scroll that line
> in view.
>
> but when there are several occurences of the searchedString, the result
> outputs only the first line.
>
> Is there a way to get all lines??? Thanks
>
> [trying to implement a dgFind function that works like the runrev find
> (showing with a rectangle the foundChunk and bouncing to next occurence... )
> if anybody has it already.. share it on revOnline please!]

Hi Robert,

The FindLine command only returns the number of the first line found as result.
To return all the lines found, you have to develop your own find command.


Regards,
--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

zryip theSlug
In reply to this post by Robert Mann
On Sun, Aug 22, 2010 at 3:45 AM, Robert Mann <[hidden email]> wrote:

>
>
> Trevor DeVore wrote:
>>
>> dispatch "FindLine" to group "DataGrid" with "MyColumn", "String To
>> Find"
>> put the result into theLine
>>
>
> Coming back to it... ok this gives me the line, then I can scroll that line
> in view.
>
> but when there are several occurences of the searchedString, the result
> outputs only the first line.
>
> Is there a way to get all lines??? Thanks
>
> [trying to implement a dgFind function that works like the runrev find
> (showing with a rectangle the foundChunk and bouncing to next occurence... )
> if anybody has it already.. share it on revOnline please!]

Robert,

Have a look to this demo stack:
http://www.aslugontheroad.co.cc/index.php?option=com_phocadownload&view=category&download=10:data-grid-helper-lib-demo&id=8:data-grid&Itemid=63

Select the "Search" topic, choose the dgh_FindLine menu and click to
the "Show me a demo" link.

Let me know if it is something like this you need.


Regards,
--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

Robert Mann
yes it is... dgh_FindLine is what I need to actually use Datagrids in real.

Still this will not make up completely for the standard find function : getting the line is fine, but drawing a rectangular round the serached string is better, and the standard a user will expect for a search function.

What has datagrid done to the world to be born without a find function?? It must be very strange for newcomers to find out that the find command  works on all fields except datagrids...

Please, let me know when you'r lib is out, I think I will pass... doing it myself.. a day saved re-inventing the wheel... and I file a bug and call for enhancement/update of the find function !!




Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

Robert Mann
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

zryip theSlug
In reply to this post by Robert Mann
On Sun, Aug 22, 2010 at 9:49 PM, Robert Mann <[hidden email]> wrote:
>
> yes it is... dgh_FindLine is what I need to actually use Datagrids in real.
>
> Still this will not make up completely for the standard find function :
> getting the line is fine, but drawing a rectangular round the serached
> string is better, and the standard a user will expect for a search function.

Hum Robert,

I have just tried the find command with a datagrid and the
corresponding strings are correctly "boxes" as expected each time I
click on my button.

For that I've added a button with a trivial script:

find tTheString

So I'm not sure to understand what you need.


Regards,
--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

Robert Mann
testing_datagrid_search.rev

An example is worth a thousand words...

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.

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.

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!

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!

Robert
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

zryip theSlug
On Sun, Aug 22, 2010 at 11:16 PM, Robert Mann <[hidden email]> 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
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

Robert Mann
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result? (half solved)

Robert Mann
Good news folks, there is a workaround !

Enabling the "cache controls" of the datagrid, forces all fields to be build in the datagrid group. Hence, the find command does finds its way to the foundCHunk.

So  we can eventually identify the foundChunk as being part of a datagrid and trigger a scroll of the datagrid..!!

Final solution will be shared on revOnline after testing by others and enhancement & suggestions... thanks for all!

testing_datagrid_search.rev




Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

Trevor DeVore
In reply to this post by zryip theSlug
On Aug 23, 2010, at 2:26 PM, zryip theSlug wrote:

> 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.

That is correct zryip.

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [datagrid] how to search and show the result?

Robert Mann
Well, folks I think that an outline thingy is kind of both a text container AND a collection of rows with columns and various pieces of information attached to each paragraph....

But anyway.. problem half solved for the time being since the size of datagrids I use is rather small, it's ok to "cache controls". And thanks to Trevors API we can get our hands into it.

 On the ground of it, the issue I raised is one of coherence because when we start to have to implement as many "find commands" as we have GUI objects.. it will be less fun!! don't you think.. ?? and even so more for newbies attracted by the X10 productivity, as advertised!