PDA

View Full Version : How to add icon in tree(urgent)



gopal_lal
21 Feb 2009, 1:26 AM
Hi All,
I am new for EXTJS. I am trying to use tree. I have successfully created Tree in my page. But I am not getting any icon in tree nodes. I also don't know how to get icon in tree.

My code of tree is


<script type="text/javascript">
Ext.onReady(function(){
alert('hi');
var Tree_Category = new Ext.tree.TreePanel({
title : 'My Category Tree',
collapsible : false,
animCollapse : true,
useArrows : true,
border : true,
id : "tree_projectcategory",
el : "tree_projectcategory",
autoScroll : true,
animate : true,
enableDD : true,
containerScroll : true,
height : 100,
width : 300

});
var Tree_Category_Root = new Ext.tree.TreeNode({
text : 'My Root Node',
draggable : false,
id : '0'
});

var Tree_Category_Root1 = new Ext.tree.TreeNode({
text : 'My child Node',
draggable : false,
id : '1'
});
Tree_Category_Root.appendChild(Tree_Category_Root1);

Tree_Category.setRootNode(Tree_Category_Root);

Tree_Category.render();
Tree_Category.expand();
});




Any pointer will be very help full.
Thanks in advance.

Regards,
Gopal lal

smit_al
21 Feb 2009, 6:02 AM
http://extjs.com/deploy/dev/docs/?class=Ext.tree.TreeNode

iconCls

gopal_lal
22 Feb 2009, 9:10 PM
Thanks, I have solved it.

Regards,
Gopal Lal