下面的简单代码描述了我的问题(至少我希望如此):
$.widget("ui.mydialog", $.ui.dialog, {
_create: function() {
// How to call _create method of dialog?
}
});
我试着打电话$.ui.dialog.prototype._create()
从上面的 create 方法中,但在 Firebug 中收到以下错误:
this.element is undefined
this.originalTitle = this.element.attr('title');
jquery...5667348 (line 5864)
我还能怎么称呼这个“超级”方法呢?
jQuery UI 版本 1.8.8
我想我刚刚找到了解决方案......$.ui.dialog.prototype._create.call(this);
完整代码:
$.widget("ui.ajaxdialog", $.ui.dialog, {
_create: function() {
// Your code before calling the overridden method.
$.ui.dialog.prototype._create.call(this);
// Your code after calling the overridden method.
}
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)