Results 1 to 2 of 2

Thread: how to get selected menu item

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    80
    Answers
    1

    Default how to get selected menu item

    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.

    Code:
                                    {                                    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'
                                            }
                                        ]
                                    },

  2. #2
    Sencha User mashiki's Avatar
    Join Date
    Oct 2007
    Location
    Japan
    Posts
    139

    Default

    in your init function of the controller.
    Code:
    'xxxpanel menuitem':{
    	scope:me,
    	click: function(item) {
    		var action=item.action,
    			itemId=item.itemId;
    		// use action or itemId
    	}
    },
    ..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •