【发布时间】:2011-04-07 06:51:10
【问题描述】:
我有一个对话框,里面有一个表单。下面的代码只是我想要做的一个例子。当你关闭一个 dijit.Dialog 时,如果你不递归地销毁他的孩子,你就不能重新打开它(使用相同的 id)。
如果你不想破坏你的小部件,你可以这样做:
var createDialog = function(){
try{
// try to show the hidden dialog
var dlg = dijit.byId('yourDialogId');
dlg.show();
} catch (err) {
// create the dialog
var btnClose = new dijit.form.Button({
label:'Close',
onClick: function(){
dialog.hide();
}
}, document.createElement("button"));
var dialog = new dijit.Dialog({
id:'yourDialogId',
title:'yourTitle',
content:btnClose
});
dialog.show();
}
}
我希望这能有所帮助,但这段代码抛出的错误是:
exception in animation handler for: onEnd (_base/fx.js:153)
Type Error: Cannot call method 'callback' of undefined (_base/fx.js:154)
我不得不说我对这个有点迷茫!快把我逼疯了^^
PS : 对不起我的“法语”英语^^
【问题讨论】:
标签: dojo dijit.form