如何在 ExtJs 中更改 Ext.window.Window 的 url

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 操作,那么它会更改父 window 的 url 而不是弹出 window。谁能帮我解决这个问题?

window 变量是对当前浏览器 window 的对象引用。这在这种情况下会很有用。

当您在 window 组件中使用 loader 时,您应该添加代码以获取加载程序并使用其方法加载新的资源位置。这样的东西应该可以工作。

button.on('click', function() {
   var loader = win.getLoader();
   loader.load('new-url')
});

参考文献:

Loader - Load Method

getLoader method