View Full Version : How to listen for event on Xtemplate element inside controller?

26 Jan 2014, 9:07 PM
Is this possible? I know to get an xtemplate element by its div class I can use Ext.query(.divClassName)....but how do I do it in this.control?

I have in this.control({

".divClassName": {
"itemclick": this.doSomething

but it does not work.

27 Jan 2014, 2:42 AM
Controllers listen for events on components (views), not elements. Elements should always be managed by their components, not treated a separate entities like you might using jQuery.

In short, the component should be listening for the DOM event and firing a relevant component event for the controller.

Further reading:


27 Jan 2014, 2:00 PM
fireEvent works. thanks