PDA

View Full Version : Change a Tree Node's Text not working - Extjs 4.1.0



Ibrahimp
23 Jul 2012, 2:08 AM
Hi,
how do i change the selected tree node text? below line doesn't work.

node.setText('abc');

Thanks in advance

regards,
Ibrahim

PS: I cannot see any method inside node interface to change a node text -- http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.NodeInterface-property-childNodes

sword-it
23 Jul 2012, 4:02 AM
Hi ibrahimp,

Try this code -



listeners:{
select:function(rModel, rec, index, eOpt){
rec.set('text', 'ibrahimp');
}
},


Working sample example http://jsfiddle.net/93R2c/

Also see http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Model-method-set

Ibrahimp
23 Jul 2012, 4:53 AM
Thanks:)