On Wed, Dec 30, 2009 at 12:00, <i...@saksys.de> wrote:

> Hi devs,
>
> i want to "copy" data from treeA to treeB. But it seams that i'm making a
> reference betwien both virtual trees.
>
> thats my code:
>
> var treeAData = treeA.getDataModel().getData();
> treeB.getDataModel().setData(treeAData);
>
> This would not bee a problem, but now both trees have a strange behavior.
>

You need to do a "deep copy" of the data model array. I thought there was a
method in qx.lang.Array to do that, but its clone() method is shallow, not
deep. You should be able to use this untested snippet, though:

var treeBData =
qx.util.Serializer.toNativeObject(treeA.getDataModel().getData(), null);
treeB.getDataModel().setData(treeBData);

Derrell
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to