I’m hooking the event handler up like this:
Ext.getCmp('MyButton').on('click', this.onClick, null, {info: "foo"});
And the handler is like this:
function onClick(event, target, options) {
alert(options);
}
I get my callback, but options is coming through as undefined. What’s going wrong? It looks to me like I’m doing what the docs suggest.
You are doing what the docs say but you are interpreting the docs wrong. The options literal you can pass as fourth argument configures the listener (settings like delay, scope, …). You can not use it to pass extra arguments to the listener function. That’s where createDelegate comes in.