On Wed, Apr 29, 2009 at 6:28 AM, Mustafa Sak <[email protected]> wrote:

> Hi Derrell,
>
> thanks for your help, but I coundn't figure it out, could you tell me, why
> i can't see any effect?
>

Yeah, it's a bit more complicated than simply reassigning the parent; it
also needs to be removed from the old parent's child list and added to the
new parent's child list. I just committed a change to SimpleTreeDataModel
that adds a move() method. Give current trunk a try. Here's a snippet from
my test program:

      var tree = new qx.ui.treevirtual.TreeVirtual(["Tree"]);
      container.add(tree, { flex : 1 } );
      var dm = tree.getDataModel();
      var root = dm.addBranch(null, "Node One", true);
      var sub1 = dm.addBranch(root, "Sub One", true);
      var sub2 = dm.addBranch(root, "Sub Two", true);
      var child = dm.addLeaf(sub2, "Child");
      dm.setData();

      var moveTo = sub1;

      var button = new qx.ui.form.Button("Move it!");
      button.addListener("execute",
                         function(e)
                         {
                           dm.move(child, moveTo);
                           dm.setData();
                           moveTo = (moveTo == sub1 ? sub2 : sub1);
                         });
      container.add(button);

Derrell
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to