Ok, works:

http://quit.rewi.hu-berlin.de/bibliograph-dev/build/#datasource~qooxdoo^itemView~referenceEditor^folderId~17^modelType~reference

Here's the code:


      var model = tree.getDataModel();
      var node  = tree.nodeGet(id);
      
      /*
       * open the tree so that the node is rendered
       */
      for (var parentId = node.parentNodeId; parentId; parentId =
node.parentNodeId)
      {
        node = tree.nodeGet(parentId);
        model.setState(node, { bOpened : true });
      }
      model.setData();
      
      /*
       * we need a timeout because tree rendering also uses
       * timeouts, so this is not synchronous
       */
      qx.event.Timer.once(function(){
        var row = model.getRowFromNodeId( id );
        if( row )
        {
          this.clearSelection();
          tree.getSelectionModel().setSelectionInterval( row, row );
        }
      },this,500);

The trick was to use a timeout, otherwise it wouldn't work. Hope this
snippet is useful for others, too. 

C. 

-- 
View this message in context: 
http://qooxdoo.678.n2.nabble.com/TreeVirtual-How-to-scroll-a-node-into-view-tp5191361p5191607.html
Sent from the qooxdoo mailing list archive at Nabble.com.

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

Reply via email to