PDA

View Full Version : [FIXED] Bug: When using handler auto method generation is not complete



MikeRH
5 Feb 2016, 9:41 AM
If you are using the "handler" config option like for a button and do the auto-method generation it just creates an empty method.

Example of a button config



{
xtype: 'button',
text: 'New Event',
handler:'onNewEvent'
}


After doing the auto-method create





onNewEvent: function () {


}


Now if I change it to a listener it works as expected.



{
xtype: 'button',
text: 'New Event',
listeners:{
click:'onNewEvent'
}
}


After the auto-method generation it looks good



/**
* @param {Ext.button.Button} component
* @param {Event} e
*/
onNewEvent: function (component, e) {


}


It looks like handler is not treated in the same way as listener. Thanks!

tristan.lee
18 Feb 2016, 8:23 PM
Thanks for the report! I have opened a request in our bug tracker.

tristan.lee
18 Feb 2016, 8:31 PM
From my understanding, the method completion generated the comment block based on which event the method is tied to. Using the listeners or on() options, the event is easily determined. As for handler, it's not as straight-forward as it would need to inspect the clickEvent (or relative) config to see which event will fire the handler.

I have filed this as a feature request for now, but if the engineers decide otherwise, it will be changed.