不同浏览器Ext.Window父窗体获取子窗体信息值

javascript代码:
    <script type="text/javascript">
        var i = 0, mygroup;
        function newWin() {
            //alert('ok');
            var win = new Ext.Window({
                id: "MyProfile",
                title: "测试弹出窗口",
                width: 800,
                height: 400,
                html: '<iframe id="frame_MyProfile" scrolling="auto" frameborder="0" width="100%" height="100%" src="../MyProfile/MyProfile.aspx"></iframe>',
                maximizable: false,
                resizable: false,
                listeners: {
                    close: function (_this) {
                        if  (navigator.userAgent.indexOf("BIDU") > 0)
                        {
                            alert(window.frames["frame_MyProfile"].document.all("txt_OrderID2").value);
                        }
                        else if (navigator.userAgent.indexOf("Chrome") > 0 || navigator.userAgent.indexOf("Firefox") > 0) {
                            alert(window.frames["frame_MyProfile"].contentWindow.document.getElementById("txt_OrderID2").value);
                        }
                        else {
                            alert(window.frames["frame_MyProfile"].document.all("txt_OrderID2").value);
                        }
                    }
                },

            });
            win.show();
        }


        Ext.onReady(function () {
            Ext.get("btnWindow").on("click", newWin);
            
            Ext.get("btnAlert").on("click", function () {
                Ext.MessageBox.alert("请注意", "这是ExtJS的提示框");
            });
        });

    </script>


html代码:

    <input id="btnWindow" type="button" value="修改" />
    <input id="btnAlert" type="button" value="消息" />

子窗体代码:

    <div style="display: none">
        <asp:Button ID="btn_Confirm" runat="server" OnClick="btn_Confirm_OnClick" />
        <input id="txt_OrderID2" type="text" value="1200" />
    </div>

    
    <script type="text/javascript">
        

        function closeWin() {

	    document.getElementById("txt_OrderID2").value=100;
            parent.Ext.getCmp('MyProfile').close();
            
        }
    </script>






你可能感兴趣的:(不同浏览器Ext.Window父窗体获取子窗体信息值)