Ext写的页面, 我在父页面弹出一个window. window里用iframe引入了一个页面. 页面有一个提交按钮, 我想在提交的同时关闭这个window, 请问我要如何操作? 

解决方案 »

  1.   

    给window设定ID,用Ext.getCmp('window的ID')方法得到这个window,再用destroy方法即可
      

  2.   

    你引入的页面可能是html,aspx等页面。不过在这些页面上没办法找到window窗体。
    看看换个方法
      

  3.   

    在iframe中关闭父页面,会有确认提示,LZ要是不能接受的话那就得换实现方式了
      

  4.   

    test1.htm
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>test1</title>
    <script>
    function closeWin(){
    window.setTimeout("window.close()",1000);
    }
    </script>
    </head><body>
    <iframe src="test2.htm"></iframe></body></html>
    test2.htm
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>test2</title>
    <script>
    function subForm(){
    window.parent.closeWin();
    document.f1.submit();
    }</script></head><body>
    <form name=f1 action="http://www.baidu.com">
    <input type=button value="submit" onclick="subForm()">
    </form>
    </body></html>
      

  5.   

    可以将父窗体,作为参数传递给子窗体,让后在子窗体接受(window.dialogArguments),可以在子窗体那边进行对父窗体的操作。
      

  6.   


    var win = parent.Ext.getCmp('window的ID');
    win.close();