本文介绍了附加jQuery UI的对话框ASP.NET表单文件准备就绪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个ASP.NET jQuery UI的对话框。我裹在对话框中的复选框的列表。因为,这是一个编辑页,有的复选框都已经检查
因为从数据获取datatbase网页时首次加载。
我没有问题,当我点击链接打开对话框,一切按预期工作。但是,如果我不点击链接,打开对话框,这些复选框
值不会从code-落后时提交表单回到回升。我理解,因为jQuery UI的对话框追加格为HTML体形式之外
当页面加载元素。
//我想追加对话框的部门形成的文件准备这样,但没有工作
。$(#对话框的部门)父()appendTo($(形式:一是));
Because there are many other fields on the page not just those checkbox. Sometime,there might be no need to open dialog to select any checkbox.
The code below works well only if I click on the link to open the dialog.
$(document).ready(function() {
// Dialog Link
$('#dialog_link_dept').click(function() {
$('#dialog-dept').dialog('open');
return false;
});
// Launch Dialog
$('#dialog-dept').dialog({
autoOpen: false,
width: 700,
modal: true,
open: function(type, data) {
$(this).parent().appendTo("form");
}
});
});
</script>
解决方案
You can move it into the <form>
immediately upon creation, even if it's autoOpen: false
, like this:
$('#dialog-dept').dialog({
autoOpen: false,
width: 700,
modal: true
}).parent().appendTo("form");
这篇关于附加jQuery UI的对话框ASP.NET表单文件准备就绪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!