On Thu, Jun 17, 2010 at 12:12, panyasan <[email protected]> wrote:

>
> Ok, works:
>
> http://quit.rewi.hu-berlin.de/bibliograph-dev/build/#datasource~qooxdoo<http://quit.rewi.hu-berlin.de/bibliograph-dev/build/#datasource%7Eqooxdoo>
> ^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.
>

Thanks, Christian.

You should really be using qx.util.TimerManager for your timers, though.
(There's a pending bug report someplace to convert the framework to use
TimerManager as well.) TimerManager uses only a single JavaScript timer and
keeps a time-ordered queue of requested events, so is a more efficient means
of handling timer needs than to instantiate a new timer for each request.

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

Reply via email to