I’m trying to set up my controller to respond to Ext.XTemplate events and avoid the mess of writing a bunch of hacked javascript.
Unfortunately, I can’t find a way to either 1) log a click event or 2) use componentQuery to register the XTemplate.
Here’s a basic controller config:
config: {
refs: {
reportChooser: 'xtemplate[id=jobReportChooser]'
},
control: {
reportChooser: {
tap: 'onAnonymousTap'
}
}
},
Is there a way to do it in the controller OR at least clean up the listeners?
I couldn’t find a direct reference since
XTemplatehas no built-in Events, but here’s a nice workaround that’s a little cleaner.In your view initialize method
What it means
Use the application
dispatch method. It will make life a lot easier and help you still organize actions inside the controller.http://docs.sencha.com/touch/2-0/#!/api/Ext.app.Application-method-dispatch