有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 : 'url+'">' }); 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()">
|
阅读(8776) | 评论(0) | 转发(0) |