On Thu, Jun 17, 2010 at 11:08, panyasan <[email protected]> wrote:
>
> Hello ( Derrell ;-) )
>
> I have a TreeVirtual widget with a really big data set loaded. The tree is
> fully collapsed, so that only the top nodes are showing. Now I know the id
> of a know deep down in the hierarchy that I want to programmatically
> select.
>
> row = mytree.getDataModel().getRowFromNodeId( id );
> mytree.getSelectionModel().setSelectionInterval( row, row );
>
> doesn't work because getRowFromNodeId() seems to return only a value if the
> node is already visible. The scrollCellVisible(column,row) method inherited
> from Table doesn't work either for a similar reason.
>
> Any idea how this could be accomplished?
>
The simple answer is, "you can't get there from here."
Since I don't believe in "can't", though, we can probably do a bit better
than that. I think you'll have to walk the tree upward from the node with
the specified id, and set its bOpened field to true. Assuming that you've
include MNode.js, you should be able to do something like this untested
snippet:
var node = tree.getNode(id);
var parentId;
for (parentId = node.parentNodeId; parentId; parentId = node.parentNodeId)
{
node = tree.getNode(parentId);
tree.setState(node, { bOpened : true });
}
tree.setState(0, { bOpened : true });
tree.setData(); // cause it to recreate row data that contains the
just-opened nodes
Then you can use the two lines you had tried, since there are rows that
contain the specified node ids.
Derrell
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel