Hybrid View
-
4 Nov 2011 8:25 AM #1
Answered: Tap event for Panel?
Answered: Tap event for Panel?
I have an application that has several Panels. Each panel host other components. I want to capture the event when the user touches anywhere in the Panel. In essence each Panel is like a big button.
How do I do this?
-
Best Answer Posted by rdougan
Just add the tap event listeners in the initialize method.
Code:initialize: function() { this.element.on({ tap: function() { console.log('tapped!'); } }); }
-
4 Nov 2011 8:56 AM #2
This is what I did but it for some reason does not work on iOS but works on the browser:
Code:Ext.define('app.view.MyView', { extend: 'Ext.Panel', ... initialize: function() { this.tapHandlerEnabled = false; this.on({ scope: this, painted: 'onPainted' }); }, onPainted: function() { if (!this.tapHandlerEnabled) { var _this = this; this.element.on('tap', function(event, html, obj) { ... _this.handleSelectionEvent(xCoor, yCoor); }); this.tapHandlerEnabled = true; } }, ... });
-
4 Nov 2011 11:22 AM #3
Just add the tap event listeners in the initialize method.
Code:initialize: function() { this.element.on({ tap: function() { console.log('tapped!'); } }); }
-
4 Nov 2011 12:08 PM #4


Reply With Quote