Created
May 20, 2014 12:42
-
-
Save ChezCrawford/0a3aa16e3c481db95676 to your computer and use it in GitHub Desktop.
Convert DOM Event to Custom Component Event in SenchaTouch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('MyApp.view.ViewWithDomEvents', { | |
extend: 'Ext.Panel', | |
config: { | |
items: | |
[ | |
{ | |
xtype: 'button', | |
itemId: 'sampleButton' | |
} | |
] | |
}, | |
initialize: function () { | |
var btn = this.down('#sampleButton'); | |
btn.element.on("doubletap", this.onDoubleTapBtn); | |
}, | |
onDoubleTapBtn: function (event, target) { | |
console.log(event); | |
console.log(target); | |
var btnComp = Ext.getCmp(event.getTarget().id); | |
btnComp.fireEvent('btnDoubleTap', btnComp); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment