On Mon, Oct 13, 2008 at 5:09 AM, Klaus-F. Kaal <[EMAIL PROTECTED]>wrote:
> Hi,
>
> I use the qx.ui.table.model.Simple to populate a table.
>
> Now, I want to implement a search facility which is done by a dopdown to
> select the column (that will sort the table in that column) and then a
> textfield which gives the search string.
>
> Is there a pattern on how I can search the table model to find out the row
> and jump to it?
>
Hi Klaus,
The answer to your question depends on what data model you're using. I'll
assume that you're using qx.ui.table.model.Simple. The table model (data
model) data is an array of rows, and each row is an array of column data.
The actual data you're putting in there is up to your application, and the
cell renderers you specify need to know how to format the data in a column
in the data model.
You can retrieve the entire set of data using dataModel.getData(). This
returns the array of rows, and you can then use any algorithm you like to
locate the search terms.
Once you've located the row that contains the search terms, you use
table.setFocusedCell() to scroll to that row. Be sure the third parameter
is the boolean value "true" to force the scroll rather than just focusing
the cell without necessarily making it visible.
Hope that helps.
Derrell
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel