0
我正在使用jQueryUI中的窗口小部件工廠。我想從回調中訪問選項哈希。在回調函數[_submitMakeHandler]中,'this'是對單擊元素的引用。jQueryUI小部件的問題,我如何訪問.deffered then()函數中的選項散列?
options: {
model: {
vehicleSelections: ko.observable({
year: ko.observable(),
make: ko.observable(),
model: ko.observable(),
submodel: ko.observable(),
engine: ko.observable()
})
}
},
_cacheMakes: function() {
var jqXHR = $.when($.getJSON('VehicleSelection/GetMakes2'));
jqXHR.then([this._loadMakes, this._templateMakes, this._submitMakeHandler]);
},
_submitMakeHandler: function (data) {
$('#formMakeSelection').delegate('a', 'click', function (e) {
debugger;
e.preventDefault();
var container = $(this).closest('div.flyout');
var link = container.data('el');
$(link).text(this.text);
//******* How do I properly access the options from here?????
});
}
感謝任何幫助或提示&技巧。我確實嘗試了這一點,它的工作原理似乎是錯誤的做法。 $.ui.widgetName.prototype.options
乾杯,
〜CK