I have a widget defined like so:
$.widget("ui.mywidget", {
_init: function() {
this.element.bind("keyup", function(event) {
alert(this.options);
alert(this.options.timeout);
});
}
});
And trying to call it like so:
$("input.mywidget").mywidget({timeout: 5});
I also redefined the bind
method using the this.element.keyup(function(event) { ... })
style: no difference.
But, in the keyup
bind, this.options
(and referencing it just as options
) both yield undefined. I thought the UI widget framework allowed this type of abstraction; am I doing something wrong?