I've created (or am trying to create) a jQuery UI widget using the widget factory and have set up my _setOptions
method this way as found here: http://wiki.jqueryui.com/w/page/12137708/How%20to%20use%20jQuery%20UI%
_setOptions: function (key, value) {
if (this.options[key] !== value) {
this.options[key] = value;
this._update();
}
},
This is my options object:
options: {
title: 'Legend',
colors: ['#0000CC', '#6600CC', '#009900', '#990000', '#6600FF', '#CCFF00', '#FF9900', '#000000', '#FFFFFF', '#00FF00'],
items: undefined
}
However, when I pass in a new title value for my legend widget, I am getting an object for key
instead of a key
and value
in _setOptions
. value
comes in undefined, for the record.
$('#myLegend').legend('option', 'title', 'New Title');
My expectations were this:
key==='title'
value==='New Title'
If there some common misconception I'm missing or can anyone think of why this would be happening?