[英]ExtJS: How to override custom minimize behavior of Ext.window.Window?
[英]How to change url of Ext.window.Window in ExtJs
我正在使用ExtJS創建模型對話框。 下面是它的代碼,
var win;
Ext.application({
name : 'Fiddle',
launch : function() {
var button = Ext.get('copy_button');
button.on('click', function(){
win = Ext.create('Ext.window.Window', {
title: 'Copy Existing',
height: 400,
width: 500,
layout: 'fit',
modal: true,
loader: {
url: '<%= request.getContextPath() %>/demo/copy.action',
autoLoad: true
}
});
win.show(this, function() {
button.dom.disabled = false;
});
});
}
});
彈出窗口中的結果頁面包含一個按鈕。 在單擊此按鈕時,我想調用struts2動作,這意味着我想更改彈出窗口的URL。
如果我使用window.location
調用struts2操作,則它將更改父窗口的URL,而不是彈出窗口的URL。 有人可以幫我嗎?
window變量是對當前瀏覽器窗口的對象引用。 這在此情況下將很有用。
在窗口組件中使用loader
,應添加代碼以獲取加載程序並使用其方法加載新的資源位置。 這樣的事情應該起作用。
button.on('click', function() {
var loader = win.getLoader();
loader.load('new-url')
});
參考文獻:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.