Yes, you can do this, but it depends on the parameters provided by the calling handler device. In the case of a button, this will be a 'click' event. But you can always look at all the arguments passed when reading the arguments array, for example
handler:function(){ console.log(arguments); }
and if you know that there is, for example, one argument that you know, you can define it (let's take a button)
handler:function(btn){ btn.disable(); }
You also need to know that alert does not have the ability to print JavaScript objects! Use console.log for this.
source share