Dojo 动画处理程序中的dijit.Dialog.hide()异常:oned
我正在创建一个dijit对话框,然后用“确定/取消”按钮隐藏它。当对话框隐藏时,我总是在javascript控制台中看到以下错误:Dojo 动画处理程序中的dijit.Dialog.hide()异常:oned,dojo,Dojo,我正在创建一个dijit对话框,然后用“确定/取消”按钮隐藏它。当对话框隐藏时,我总是在javascript控制台中看到以下错误: exception in animation handler for: onEnd TypeError: Cannot read property 'remove' of undefined(…) 请看这里: 这个错误似乎不会影响任何事情,但我很乐意解决它,这样在调试时就不会把这个错误与真正的功能问题混淆 我读过很多关于类似错误的建议。。。使用lang.hitch
exception in animation handler for: onEnd
TypeError: Cannot read property 'remove' of undefined(…)
请看这里:
这个错误似乎不会影响任何事情,但我很乐意解决它,这样在调试时就不会把这个错误与真正的功能问题混淆
我读过很多关于类似错误的建议。。。使用lang.hitch,断开与事件的连接,但似乎什么都不起作用/不适用。救命啊
下面是我的一段对话代码:
function showMessageDialog(title, message, width) {
var content,
focusOnOkButton = function () {
dojo.byId('messageDialogOk').focus();
};
if (!dijit.byId("messageDialog")) {
new dijit.Dialog({}, "messageDialog").startup();
new dijit.form.Button({
onClick: function() {
dijit.byId('messageDialog').hide();
}
}, "messageDialogOk").startup();
}
if (width) {
dojo.byId('messageDialogTable').style.width = width + "px";
} else {
dojo.byId('messageDialogTable').style.width = "450px";
}
dijit.byId('messageDialog').resize();
dijit.byId('messageDialog').set("title", title);
content = dojo.byId("messageDialogMessage");
dojo.empty(content);
content.innerHTML = message;
dijit.byId('messageDialog').show();
setTimeout(focusOnOkButton, 50);
}
..以及相关的HTML:
<div id="messageDialog" style="display:none;">
<table id="messageDialogTable" style="width:450px;table-layout: fixed;">
<tr>
<td colspan="2" style="padding: 0 0px 0px 5px;">
<table style="width: 100%;">
<tr>
<td id="messageDialogMessage" style="font-size: 10pt;"></td>
</tr>
<tr>
<td style="padding: 5px;text-align: center;">
<div id="messageDialogOk">OK</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
好啊
我试图用一个简单的JSFIDLE示例来复制这个问题,但无法。。。所以我的应用程序中有一些东西。。。但不确定会是什么