-
25 Nov 2011 8:13 AM #1
Unanswered: Event Controllers Don't Exist for Certain Components?
Unanswered: Event Controllers Don't Exist for Certain Components?
I have everything properly set up to handle events for my main menu. For some reason, inside the init function of my controller, mouseover only works for menus, not their items. I've tried everything and I just can't seem to get it working. Are they supposed to have this event? Here is my controller code:
Code:Ext.define('Agile.controller.Main', { extend: 'Ext.app.Controller', views: ['ui.Container'], init: function() { this.control( { 'menu > menuitem': { click: this.onClick, }, 'syntax': { mouseover: this.onMouseOver } } ); }, onClick: function(objBtn, objMenu, objOptions) { console.log('click fired') strID = objBtn.id; switch (objBtn.id) { case "syntax": // Need the mouseover event to fire here to eliminate redundancy. Syntax // is a child menu, just toe explain. console.log('syntax wee'); break; } }, onMouseOver: function(objBtn) { console.log('mouseover fired') console.log(objBtn) refreshViewSettings(); } } );
-
25 Nov 2011 8:45 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
- Answers
- 3156
If your ComponentQuery selector can return a Component then any of it's events can be listened to in your Controller. I'm assuming your click handler works as I just tested it and it worked for me. Your mouseover will not work because there is no mouseover event listed for the Ext.menu.Item.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
25 Nov 2011 11:40 AM #3
-
25 Nov 2011 4:17 PM #4
Is there a way to have all menus exist initially in the DOM but have their visibility set to hidden like how it is later when they're not active?


Reply With Quote