swiji2000
6 Sep 2012, 4:06 AM
Hi
I need to add item inside the menuitem dynamically.
menu:{
xtype:'menu',
id:'toolMenu',
items:[{
}]
}
Ext.getCmp('toolMenu').add({xtype:'menuitem',id:'submenu1',text:'abc'});
I want to add like following,
Ext.getCmp('submenu1').add([{xtype:'menuitem',id:'submenu2',text:'xyz'}]);
But i am getting the following error:
TypeError: Ext.getCmp("submenu1").add is not a function
please help me to add items here..
Thanks
I need to add item inside the menuitem dynamically.
menu:{
xtype:'menu',
id:'toolMenu',
items:[{
}]
}
Ext.getCmp('toolMenu').add({xtype:'menuitem',id:'submenu1',text:'abc'});
I want to add like following,
Ext.getCmp('submenu1').add([{xtype:'menuitem',id:'submenu2',text:'xyz'}]);
But i am getting the following error:
TypeError: Ext.getCmp("submenu1").add is not a function
please help me to add items here..
Thanks