如何在ext中关闭子窗口

 

ext开发,如何编写选择数据的子窗口--需要在子窗口的javascript代码中返回所选数值,并关闭子窗口自己

1、父窗口程序:

<script>

var win;

// 弹出选择客户子窗口
function showCustSelect() {
 
 win = new Ext.Window({
   title : '客户选择' ,
   width : 800,
   height : 480,
   isTopContainer : true,
   modal : true,
   resizable : false,
   contentEl : Ext.DomHelper.append(document.body, {
    tag : 'iframe',
    style : "border 0px none;scrollbar:true",
    src : '/CB/pages/ext/CustSelect.jsp',
    height : "100%",
    width : "100%"
   })
  }); 
  win.show();
 
}    

Ext.onReady(function(){
  ......
  { xtype:'button', width:30, text:'...',  anchor:'80%', listeners: {click:{fn:showCustSelect}}}
  ......
}

</script>

2、子窗口程序

// 在需要返回值和关闭子窗口的地方
var value = ......;
parent.selectCustOK(value);


 

猜你喜欢

转载自blog.csdn.net/caim/article/details/6951737