I'm starting a new project in which I need my custom component called "TriggerFieldClick" which fires "triggerclick" event. Since SD currently doesn't allows to register non custom events in controllers, the work arround is to call again controller's control() method in init() after SD generated code:
Code:
onButtonClick: function(button, e, options) {
alert("Click!");
},
init: function() {
this.control({
"mywindow #mybutton": {
click: this.onButtonClick
}
});
// Non custom events...
this.control({
"mywindow #mytrigger": {
"triggerclick": this.triggerTest
}
});
},
triggerTest: function(e) {
alert("Funcionó !");
}
I checked Controller, Application adn EventBus code to ensure that control() doesn't clear previos registered listeners.
Regards.