PDA

View Full Version : tree node style in extjs 4.0



sivarkp
28 May 2012, 5:43 AM
hi, i have created tree structure in extjs 4.0 like this

var tree1=Ext.create('Ext.tree.Panel', {
renderTo: 'MASTER_TAB_SERVICES',
title: 'Simple Tree',
width: 150,
height: 150,

root: {'text': 'Root','id':'c','expanded': true,'type':'root','iconCls' : 'no-icon','children': [{'expanded': true,'id':'service1','type':'service','text':'Hair Care','iconCls' : 'no-icon','children': [{'text': 'Womens Haircut','iconCls' : 'no-icon','leaf': false,'type':'category','id':'category1'},{'text': 'Childs Haircut','iconCls' : 'no-icon','leaf': false,'type':'category','id':'category2'}]},{'text':'Bridal/Groom Services','type':'service','iconCls' : 'no-icon','expanded': true,'id':'service2','children': [{'text': 'Bridal Consultation','iconCls' : 'no-icon','leaf': false,'type':'category','id':'category3'},{'text': 'Bride Preparation','iconCls' : 'no-icon','leaf': false,'type':'category','id':'category4'}]}]},
listeners :{
itemclick:addC,
select:addS
}

});



i need information , how to change font style of paricular node. i tried with iconsCls. it is not working. please help me.........

skirtle
29 May 2012, 2:30 PM
Have you tried putting a cls on your nodes?

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.NodeInterface-cfg-cls

Use a debugger to inspect the DOM elements in your tree. You should see the cls applied as a CSS class to the tree node. It's then just a case of crafting a suitable CSS rule to change the font.