Sencha Inc. | HTML5 Apps

Tree FAQ

Published Sep 17, 2010 | The Sencha Dev Team | FAQ | Medium
Last Updated Jul 11, 2011

This FAQ is most relevant to Ext JS, any version.

This article is currently due for review
We suspect that this article may be out-of-date or contain incorrect information.
But we are constantly editing articles, so we promise we will get to this one soon.

Specificing tree node icons

A Tree Node with no children is a leaf node. If you want a node to always have a certain icon, use the iconCls attribute to give it a class name eg:

myNode.appendChild(new Ext.tree.AsyncTreeNode({
    text: "A folder",
    iconCls: "folder"
});

Then specify appropriate CSS rules, eg:

.x-tree-node img.folder, .x-tree-node-collapsed img.folder{
    background: url("../images/default/tree/folder.gif");
}
 
.x-tree-node-expanded img.folder {
    background: url("../images/default/tree/folder-open.gif");
}

How to remove a child

tree.selModel.selNode.parentNode.removeChild(node);
Share this post:
Leave a reply

Written by The Sencha Dev Team

2 Comments

NotImportant

3 years ago

hmmm there are only 10 Lines of FAQ???

Jon Cook

3 years ago

Also there is no class: Ext.tree.AsyncTreeNode
http://docs.sencha.com/ext-js/4-0/#

Leave a comment:

Commenting is not available in this channel entry.