dojo ie9 destory在表单上递归
我有一个使用 xhrPost 提交的表单,并返回表单结果,然后再次返回表单以让用户输入更多详细信息。该代码在 Chrome 中有效,但在 IE 中, destroy 和 destroyRecursive 似乎不起作用,并且 ajax 返回将导致小部件已注册错误。
该表单使用声明性格式加载到 dojo 对话框中,当对话框打开并准备就绪时调用此函数:
var loadFunc = function() {
dojo.parser.parse('quickaddcontainer');
dojo.query('#quickAddBooking').onsubmit(function(e) {
e.preventDefault();
var xhrArgs = {
form: dojo.byId("quickAddBooking"),
url: '/booking/admin/quickadd?popup=1',
handleAs: "text",
load: function(data) {
dojo.place(data, 'quickaddcontainer', 'replace');
loadFunc();
},
error: function(error) {
dojo.byId("quickaddcontainer").innerHTML = "Form error: "+error;
}
}
dojo.byId('quickaddcontainer').innerHTML = 'Loading...';
dojo.xhrPost(xhrArgs);
dijit.byId('quickAddBooking').destroyRecursive();
});
}
有什么想法为什么这在 IE 中不起作用?我尝试在 xhrPost 调用甚至 findWidgets - destroyRecursive 之前在加载函数中放置 destroy/destroyRecursive ,但似乎没有做任何事情。
Moan:有时用 dojo 做这么简单的事情似乎很难 - 在其他框架中重新渲染永远不会引起问题。
I have a form that submits with xhrPost, and comes back with the form result, and the form again to let users enter more details. The code works in Chrome but with IE the destroy and destroyRecursive doesn't seem to work and the ajax return will results in a widget already registered error.
The form is loaded into a dojo dialog box, using declarative formatting, this function is called when the dialog box has opened and is ready:
var loadFunc = function() {
dojo.parser.parse('quickaddcontainer');
dojo.query('#quickAddBooking').onsubmit(function(e) {
e.preventDefault();
var xhrArgs = {
form: dojo.byId("quickAddBooking"),
url: '/booking/admin/quickadd?popup=1',
handleAs: "text",
load: function(data) {
dojo.place(data, 'quickaddcontainer', 'replace');
loadFunc();
},
error: function(error) {
dojo.byId("quickaddcontainer").innerHTML = "Form error: "+error;
}
}
dojo.byId('quickaddcontainer').innerHTML = 'Loading...';
dojo.xhrPost(xhrArgs);
dijit.byId('quickAddBooking').destroyRecursive();
});
}
Any ideas why this doesn't work in IE? I've tried putting a destroy/destroyRecursive in the load functions, before the xhrPost call and even findWidgets - destroyRecursive on the form but none seem to do anything.
Moan: It seems so hard to do such simple things with dojo sometimes - re-rendering in other frameworks never causes a problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎我已经回答了我自己的问题...将innerHTML 调用移动到底部是有效的。
Seems I have answered my own question... moving the innerHTML call to the bottom worked.