我的数据保存在选项变量中,但是在选择列表的事件(OnChange)中
this 引用 DOMElement,因此 this.options 引用对象列表。
我能拥有的其他地方
var o = this.options;
但这在这种情况下没有用。
如何获取/设置小部件信息?
Use the this._on() method http://api.jqueryui.com/jQuery.widget/#method-_on绑定处理程序。此方法由 jQuery UI 小部件工厂提供,并将确保在处理程序函数中,this
始终引用小部件实例。
_create: function () {
...
this._on(this.selectElement, {
change: "_onChange" // Note: function name must be passed as a string!
});
},
_onChange: function (event) {
// 'this' is now the widget instance.
},
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)