Chinaunix首页 | 论坛 | 博客
  • 博客访问: 343961
  • 博文数量: 30
  • 博客积分: 4156
  • 博客等级: 上校
  • 技术积分: 945
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-14 15:00
文章分类

全部博文(30)

文章存档

2013年(2)

2012年(4)

2010年(9)

2009年(7)

2008年(8)

我的朋友
最近访客

分类: 系统运维

2010-01-03 10:38:30

    有a,b两个页面,a页面为主页面,有按钮一个,点击按钮弹出一个windows对象,在其中显示b页面。b页面中也有一个按钮,点击关闭窗口。
a.htm (部分代码)
 

<script type="text/javascript">
function openWindow(id,title,url,width,height){
    var win = Ext.get(id)
    if (win) {
        win.close();
        return;
    }
    win = new Ext.Window({
        id:id,
        title:title,
        layout:'fit',
        width:width,
        height:height,
        closeAction:'close',
        collapsible:true,
        plain: false,
        resizable: true,
        html : ''
    });
    win.show();
}

function myfunction(){
    openWindow('b-win','窗口中打开b页面','b.htm',400,300);
}
</script>
<input type="button" name="button1" value="打开窗口" onClick="myfunction()">

b.htm(部分代码)

<script type="text/javascript">
function closewin(){
    var win = parent.Ext.getCmp('b-win');
    if (win) {win.close();}
}
</script>
<input type="button" name="button1" value="关闭a打开的窗口" onClick="closewin()">


阅读(1276) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~