(sorry my english)
Hi. 
I'm working with a qx.ui.tree.VirtualTree, and I need add some parent node
reference to each node.
I'm trying with this example (below) but i get problems and I cant fix the
problem.

Please give me some little little example about how work with parent
references. I cant understand how work correctly and where is the error.


my example:


var doc = this.getRoot();
                
var functionPrepare = function(nodo, parent) {
        nodo.set("parentNode", parent);
        
        var children = nodo.get("children");
        var length = children.getLength();
        for (var x=0; x < length; x++) {
                functionPrepare(children.getItem(x), nodo);
        }
}

var nodes = {
                                  descrip: "root",
                          parentNode: {},
                          children: [
                            {
                              descrip: "Argentina",
                              parentNode: {},
                              children: [
                                {
                                  descrip: "Cordoba",
                                  parentNode: {},
                                  children: [
                                    {
                                      descrip: "Capital",
                                      parentNode: {},
                                      children: [
                                        {
                                          descrip: "Cordoba",
                                          parentNode: {},
                                          children: []
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              descrip: "Brasil",
                              parentNode: {},
                              children: []
                            }
                          ]
                        }

nodes = qx.data.marshal.Json.createModel(nodes, true);


var vtUbicacion = new qx.ui.tree.VirtualTree(nodes, "descrip", "children");
vtUbicacion.setWidth(300);
doc.add(vtUbicacion, {left: 100, top: 20});
                
functionPrepare(nodes, null);

--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/parent-nodes-and-qx-ui-tree-VirtualTree-tp7580240.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to