在ASP.NET的回传jQuery的模态对话框 [英] jQuery modal dialog with postbacks in ASP.NET
问题描述
我刚刚升级我的jQuery / jQuery UI的的到最新版本(1.9.0的jQuery和jQuery UI 1.10.0 ),它似乎已经打破了我的一些jQuery UI的对话功能。
I just upgraded my jQuery/jQuery UI to the latest version (jQuery 1.9.0, jQuery UI 1.10.0), and it seems to have broken some of my jQuery UI dialog functionality.
为了做回发在ASP.NET一个jQuery UI对话框,有一个pretty常见的解决方法,你将有你的DIV重新添加到主窗体,因为jQuery的将重新构建DIV该窗体之外的,就像这样:
In order to do postbacks in a jQuery UI dialog in ASP.NET, there was a pretty common workaround where you would have to re-append your DIV to the main FORM, since jQuery would re-construct the DIV outside the FORM, like so:
$("#newInsurance").dialog({
autoOpen: false,
modal: true,
open: function (type, data) {
$(this).parent().appendTo($("form:first"));
}
});
不幸的是,因为这个升级现在把该对话框的背景灰色/禁用覆盖后面。因此,在弹出的形式是不可用的,所有变灰。我试过几件事情,我似乎无法得到它的工作 - 它好像这个老变通不再起作用。有谁知道一个新的变通办法,将工作的?还是我失去了一些东西?直到我升级这个工作很大的。
Unfortunately, since upgrading this now puts the Dialog behind the gray/disabled overlay for the background. So the form in the Popup is unusable and all grayed out. I've tried several things and I can't seem to get it to work - it seems as if this old work-around no longer works. Does anyone know of a new work-around that will work? Or am I missing something? This worked great up until I upgraded.
下面是关于工作围绕用来工作的一些详细信息:
Here is some more information about the work-around that USED to work:
-
堆栈溢出问题的 jQuery用户界面对话框(木代尔),prevents任何回发
堆栈溢出问题的 $(#dialog).parent().appendTo($(form:first));
Stack Overflow question $("#dialog").parent().appendTo($("form:first"));
堆栈溢出问题的 jQuery的模态窗体对话框的回发问题 的
Stack Overflow question jQuery modal form dialog postback problems
我在Internet&NBSP测试这9和谷歌Chrome 24.x
I tested this with Internet Explorer 9 and Google Chrome 24.x
按照jQuery UI的网站,对话框API已经完全在jQuery UI的重新设计1.10.0
According to the jQuery UI website, the Dialog API has been completely redesigned in jQuery UI 1.10.0:
推荐答案
确定,因此这似乎是jQuery UI的1.10修补程序:
OK, so this seems to be the fix for jQuery UI v1.10:
$("#newInsurance").dialog({
autoOpen: false,
appendTo: "form",
modal: true
}).parent().css('z-index', '1005');
在jQuery UI的V1.10他们增加了一个 appendTo 的属性,它似乎做同样的事情与调用 .parent()。appendTo($(形式 ))
。诀窍修复是z-index的。
In jQuery UI v1.10 they added an appendTo property, which seems to do the same exact thing as calling .parent().appendTo($("form"))
. The trick to the fix is the z-index.
这篇关于在ASP.NET的回传jQuery的模态对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!