我想從一個子窗口中打開父窗口中的jQuery UI對話框。換句話說,因爲孩子只能在其窗口的約束下彈出對話框,所以我希望能夠在父窗口的約束條件下使用對話框彈出窗口的內容。你如何在父/開啓器窗口中打開一個jQuery UI對話窗口?
我試圖使用window.opener來綁定鏈接,但沒有太多的運氣。
下面是從骨幹查看HTML頁面打開的窗口中代碼:
popoutWindow = window.open("campaign/genericPopout.aspx", "search", "width=800, height=600, toolbar=0, status=0, menubar=0, scrollbars=1, resizable=1", true);
的genericPopout.apsx的號召,即建立,與骨幹網景,使用此命令文件中,
new popupSearchView();
它調用下面的骨幹查看:
var popupSearchView = Backbone.View.extend({
events: {
"click #closeBtn" : "closePopupSerachView"
},
initialize: function() {
this.template = _.template("<div id='searchPopupView'>" +
"<div style='width: 100%; text-align: center;'>Hello World</div>" +
"<div style='text-align: center;'><input type='button' id='closeBtn' value='Close' /></div>" +
"</div>"
);
this.render();
},
render: function() {
formString = this.template();
$(formString).dialog({
autoOpen: true,
height:460,
width: 350,
title: "Search",
modal: false
})
return this;
},
closePopupSearchView: function() {
$(this).dialog("close");
}
});
它打開彈出式撥號在新打開的窗口內沒有問題,但它似乎不起作用。在父窗口中的HTML,我專門爲這個對話框一個div:
<div id="popupSearchViewDiv"></div>
,我試圖通過這個骨幹EL設置爲這個div:
el: $("popupSearchViewDiv", window.opener.document)
然而,這似乎並沒有工作。有關我如何完成此任務的任何想法?
謝謝你