-
9 Sep 2012 11:00 PM #1
Unanswered: Get MenuItem Id & Text
Unanswered: Get MenuItem Id & Text
Hi,
How to get menu item id and text [as we defined] when we click that menu item?
Thanks.
-
9 Sep 2012 11:21 PM #2Sencha - Community Support Team
- Join Date
- May 2012
- Location
- Istanbul
- Posts
- 1,331
- Vote Rating
- 77
- Answers
- 124
Hi swiji2000,
Try the code given below:
Code:Ext.create('Ext.menu.Menu', { width: 100, margin: '0 0 10 0', floating: false, renderTo: Ext.getBody(), defaults:{ listeners:{ click : function(menu,item,e){ alert(menu.text); // it will display the text of clicked menu item. alert(menu.id); // it will display the id of clicked menu item. } } }, items: [{ text: 'New' , id: 'newMenuItem' },{ text: 'Save' , id: 'saveMenuItem' }] });sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
12 Sep 2012 2:10 AM #3


Reply With Quote