PDA

View Full Version : how to get selected menu item



Anthony.Hall
3 Aug 2012, 6:28 AM
I have the following menu. How can i get the selected item. ie i would like to know the action name of the selected menu item.


{ xtype:'button',
text:'Search By',
itemId:'filter_by',
id:'SearchBy',
name:'SearchBy',
arrowAlign:'right',
width:'100',
menu:[
{
text:'Cutter Number',
checked:true,
group:'filter',
itemId:'CutterNumber',
action:'CutterNumber'
},
{
id:'ProjectNumber',
text:'Project Number',
checked:false,
group:'filter',
itemId:'ProjectId',
action:'ProjectId'
},
{
text:'Job Number',
checked:false,
group:'filter',
itemId:'JobId',
action:'JobId'
}
]
},

mashiki
4 Aug 2012, 12:01 AM
in your init function of the controller.


'xxxpanel menuitem':{
scope:me,
click: function(item) {
var action=item.action,
itemId=item.itemId;
// use action or itemId
}
},
..