Hi,

In the following example, how can I get the children of the selected nodes
(to count them or to collect the names,...)?

Thanks


      qx.Class.include(qx.ui.treevirtual.TreeVirtual,
                       qx.ui.treevirtual.MNode);
                       
       var hBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(20));
      this.getRoot().add(hBox, { edge : 30 });
      var tree = new qx.ui.treevirtual.TreeVirtual("Tree");
      tree.setAlwaysShowOpenCloseSymbol(true);
      hBox.add(tree);
      var dataModel = tree.getDataModel();
      var te1 = dataModel.addBranch(null, "A", true);
      tree.nodeSetLabelStyle(te1, "background-color: red; color: white;");
      dataModel.addBranch(te1, "AA", true);
      var te = dataModel.addBranch(te1, "AB", true);
      dataModel.addLeaf(te, "ABA");
      dataModel.addLeaf(te, "ABB");
      
      dataModel.setData();
      var commandFrame = new qx.ui.groupbox.GroupBox("Control");
      commandFrame.setLayout(new qx.ui.layout.VBox(8));

      hBox.add(commandFrame);
      
      var listButton = new qx.ui.menu.Button("Tests");
      commandFrame.add(listButton);
      
      listButton.addListener(
        "execute",
        function(e)
        {
          var selectedNodes = tree.getSelectedNodes();
          for (var i = 0; i < selectedNodes.length; i++)
          { 
           // How to obtain children?
            alert(selectedNodes[i].nodeId);
          }
        });


--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/get-children-of-a-treevirtual-node-tp7356189p7356189.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to