0

I have the following code.

Ext.define(foo.MyComponent, {
   extend: 'Ext.Component',
   tpl: new XTemplte({'blah blah'}),
   data: {},
   initComponent: function(){
       this.callParent(arguments);
       this.on('click', function () {alert(1)});
   }
});

This is rendering properly. But the click event I am attaching inside initComponent is not getting registered. Am I missing something? I am using ExtJS 4.2.1

Selvaraj M A
  • 3,096
  • 3
  • 30
  • 46
  • does your component fire click event? because Ext.Component does not. – dbrin Oct 11 '13 at 18:25
  • How about mouseover and mouseout? Where can I get this detail? – Selvaraj M A Oct 11 '13 at 18:50
  • Nope. Those are DOM events. The docs list all of the events a particular component supports: http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.Component – dbrin Oct 11 '13 at 20:12
  • Event handling tutorial question has already been sufficiently answered: http://stackoverflow.com/questions/7260134/extjs-4-event-handling-tutorials/16346425 – dbrin Oct 11 '13 at 20:28

0 Answers0