1

ウィジェットを拡張しようとした後、ウィジェットを破棄して再作成してもうまくいかないようです。

$.widget("ui.specialDialog", $.ui.dialog, {
    _create: function () {
        $.ui.dialog.prototype._create.call(this);
     }
});


$('#warningDialog').specialDialog();
$('#warningDialog').specialDialog('destroy');
$('#warningDialog').specialDialog();
// the dialog does not show up here


$('#warningDialog').dialog();
$('#warningDialog').dialog('destroy');
$('#warningDialog').dialog();
// this works

ウィジェットを拡張しているときに、ここで何か見逃しましたか?

4

1 に答える 1

2

これは、jquery ui の 1.8 バージョンのバグです。ui.dialog の 'destroy' 関数は、その親の 'destroy' を呼び出しません。

これを「destroy」に追加すると、問題が解決します。

$.Widget.prototype.destroy.apply(this, arguments);
于 2013-03-06T17:01:32.400 に答える