PDA

View Full Version : TreePanel children and nodes



yo_haha
16 Oct 2012, 11:45 PM
Hi,

I have a TreePanel which I fill by setting children to its root:


root: {
nodeType: "async",
expanded : true,
children: [{
text: 'Child 1',
checked: true,
draggable: false,
leaf: false,
expanded: true,
singleClickExpand: true,
children: [{
text: 'Child 1.1',
draggable: true,
checked: true,
leaf: true
} ...

When I try to reach the tree children by


tree.root.firstChild;

I get a null object.
The same thing with


tree.root.ChildNodes

However, the method


tree.root.hasChildNodes()

returns true.
Do you have an explanation?

Regards

sword-it
17 Oct 2012, 12:18 AM
Hi,

you can check this link : http://www.sencha.com/forum/showthread.php?201079-Select-first-children-of-TreePanel

yo_haha
17 Oct 2012, 1:03 AM
tree.getSelectionModel().select(tree.getRootNode());
tree.selectPath(tree.getRootNode().getPath('text'), 'text');

retun



TypeError: Ext.fly(node.ui.wrap) is null

and getChildAt() doesn't exist. I'm using ExtJs 3.4. I'm sorry I didn't specify it from the beginning.

scottmartin
17 Oct 2012, 8:22 AM
Moved to Ext3 forums.