0

我有一个页面 1.aspx 包含一个网格 extjs。在第 2.aspx 页中,我使用函数 ext.window 调用第 1.aspx 页,然后如何在 iframe 第 1 页、.aspx 中获取 id 网格。

示例第 2 页当我调用它时

var win = new Ext.Window({
                    title: ''
                      , width: 700
                      , height: 500
                      , plain: true,
                    html: String.format('<iframe id="report" frameborder="0" src="1.aspx" width="100%" height="100%" />'),
                    listeners: {

                        close: function () {
                            debugger;
                            var q = $("#report").contents().find("#grid");
                        }
                    }
                });
                win.show();
                win.center(); 

在第 1 页中包含网格

谢谢大家的帮助

4

1 回答 1

0

Store the grid object in your page 1.aspx in a global variable i.e.

window.myGrid = yourGrid;

Then you can access your grid from your page 2.aspx like that:

var myGrid = document.getElementById('report').contentWindow.myGrid;

(This only works if the iframe and the page from where you are accessing it are in the same domain).

于 2013-05-30T07:21:21.587 回答