On Wed, May 5, 2010 at 11:46, schlomer <[email protected]> wrote:
> > Hello. > > I have a treevirtual structure with ~200 first level branches, each with > ~10-20 leaves. I am implementing a type-ahead, auto-complete search > feature > to find an exact node. This all works, and I am able to pinpoint the exact > branch, and expand it, revealing its leaves, however, due to the tree's > size, I would like to do two things: > > Scroll the tree to the opened branch, and do a Highlight Effect animation > on > the desired nodes. > > I am confident this is possible, provided I am able to find the node's DOM > element. So, my question is, and I apologize if this has been asked and > answered before, (I have been unable to find an answer,) Is it possible > to > get the DOM element of a treevirtual node? > Recall that treevirtual renders only as needed, so if you needed to scroll the node into view, what's really happening is that the existing DOM elements in the visible portion of the tree are re-used or overwritten such that their data is replaced with the data appropriate to the tree nodes coming into view. In other words, unlike with the traditional qx.ui.tree.Tree, this virtual widget does not assign a DOM element to each node of the tree; only to those which are visible. Scrolling the tree to the opened branch is easy. You can call tree.scrollCellVisible(col, row). This will cause the tree node to be made visible if it isn't already. Highlighting the cell is more problematic. I think I'd start by looking at the method qx.ui.table.pane.Pane._scrollContent() which is where the DOM nodes are created. Much of it the content is generated by creating HTML text and using the innerHTML property, which gives you no useful DOM node to work with, but the rows themselves do have DOM nodes that are created in the _scrollContent() method. That may be useful to you. You can try, as Martin suggested, to do this in the cell renderer, but given that it simply generates a stream of HTML text which is later added using innerHTML, I believe you'll have difficulty. Hopefully overriding _scrollContent() in Pane will prove useful. In case you don't realize it, there is a separate Pane for each meta column, so keep that in mind. Cheers, Derrell
------------------------------------------------------------------------------
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
