On Fri, Sep 4, 2009 at 14:53, aditya siram <[email protected]> wrote:

> Hi all,
> Is there a way of programatically selecting a node in a TreeVirtual so that
> it's entire hierarchy is opened?  In a table the 'setSelectionInterval'
> method works fine, but it takes row indices. Is there something similar for
> a TreeVirtual?
>
>
> Hi Deech,

You're using two terms here that mean different things. An "opened" node is
a Branch node that has its children (if any) displayed. A "selected" node is
as you've seen with Table, where it is highlighted or otherwise indicated as
being selected, and one can retrieve the set of selected nodes.

There is no built-in mechanism for recursive opening nor selecting all
sub-trees of a node, but let me provide some pointers that will help you
implement this functionality for your application. It should not be
difficult.


   1. If you have a row index, you can obtain the node object with
   dataModel.getNodeFromRow(rowIndex)
   2. Look at the documentation for the class SimpleTreeDataModel. It shows
   the object structure of a node, which you may find quite useful.
   Specifically, the 'children' array which is calculated during the rendering
   process contains a list of the children of a particular node.
   3. Include the MNode mixin to your TreeVirtual object, to provide useful
   utility functionality, specifically the methods treeVirtual.nodeSetOpened()
   and and treeVirtual.nodeSetOpened().

With those (and a careful review of either the API docs or the source code),
you should be able to easily implement your desired functionality.

Cheers,

Derrell
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to