Hi there,
Have you ever discussed triggering a callback in _setOption so that you can listen to state changes within a widget. For instance I want do something whenever the disabled state is changed however there's no way to know this as it currently stands...
This is what I mean:
- _setOption: function (key, value) {
this.options[key] = value;
if (key === "disabled") {
this.widget()
[value ? "addClass" : "removeClass"](
this.widgetBaseClass + "-disabled" + " " +
"ui-state-disabled")
.attr("aria-disabled", value);
}
this._trigger(key + 'Change', null, {
val: value
});
return this;
},
I've probably not thought about this is the context of all widgets but it's just a thought.
Cheers,
Rich