Skip to content

Instantly share code, notes, and snippets.

@ChezCrawford
Created May 20, 2014 12:42
Show Gist options
  • Save ChezCrawford/0a3aa16e3c481db95676 to your computer and use it in GitHub Desktop.
Save ChezCrawford/0a3aa16e3c481db95676 to your computer and use it in GitHub Desktop.
Convert DOM Event to Custom Component Event in SenchaTouch
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