ext的弹出窗口关闭

首先是js的弹出窗口函数:

  1. //新增一个在点了确定以后就可以关闭的窗口
  2. function openWindowCanClose(url,title,width,height)
  3. {
  4.     try{
  5.     var dt=new Date();
  6.     var iframeId="dailogIframe_"+dt.getHours()+""+dt.getMinutes()+""+dt.getSeconds()+""+Math.random();
  7.     var ifame_html="<iframe id='"+iframeId+"' src='"+url+"' style='BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 100%; BORDER-BOTTOM: 0px; HEIGHT: 100%' frameBorder='0' scrolling='no'></iframe>"
  8.     var win=new Ext.Window({
  9.                     title: title,
  10.                     closable:true,
  11.                     width:width,
  12.                     height:height,
  13.                     border:false,
  14.                     plain:true,
  15.                     closeAction:'close',                 
  16.                     items: [
  17.                     new Ext.Panel({  
  18.                     height:height-30, 
  19.                     html:ifame_html                   
  20.                          })
  21.                     ]
  22.                 });
  23.          win.show();
  24.          win.on("close",function(p)
  25.          {
  26.             document.getElementById(iframeId).src="";
  27.             //document.removeChild(document.getElementById(iframeId)); 
  28.          }); 
  29.          return win;
  30.          }catch(e){alert(e);}
  31. }
在调用的时候:
  1. grid_DataStore.load({params:{start:0, limit:pageSize}}); 
  2.     function e_register(btn, e){
  3.      xxxxOpenDialog=openWindowCanClose("register.html",'添加纠纷信息',650,500);
  4.     }
其中: xxxxOpenDialog是一个全局变量 
在弹出窗口的button确定按钮点击以后:
  1.       buttons: [{
  2.             text: '确定',
  3.             handler:function(btn){
  4.            if(!editPanel.form.isValid())return;
  5.             var formLength=editPanel.form.items.items.length;
  6.              JFInfo=new Object(); 
  7.              for(var i=0;i<formLength;i++)
  8.              {
  9.                 var control=editPanel.form.items.items[i];
  10.                 if(typeof(control.getValue())=="object")
  11.                 {
  12.                     JFInfo[control.name]=control.value; 
  13.                 }else
  14.                 {
  15.                     JFInfo[control.name]=control.getValue(); 
  16.                 }
  17.              }                   
  18.                      JFInfo["n_rydh"]=getRequestParame("id");
  19.                      JFInfo["n_cldh"]=getRequestParame("n_cldh");
  20.                      JFInfo["n_rwdh"]=getRequestParame("n_rwdh");
  21.                       if( JFInfo["n_rydh"]==0){
  22.                         JFInfo["n_rydh"]=null;
  23.                       } 
  24.                       if(JFInfo["n_cldh"]==0){
  25.                         JFInfo["n_cldh"]=null;
  26.                       }
  27.                       if(JFInfo["n_rwdh"]==0){
  28.                         JFInfo["n_rwdh"]=null;
  29.                       }
  30.                     Ext.MessageBox.confirm("新增提示","确定要增加纠纷信息吗?",function(e){    
  31.             if(e=="yes"){       
  32.                       MailLoseBotherManage.addBotherInfo(JFInfo,function(value){
  33.                     parent.parent.alertMsg(value.msg);
  34.                     if(value.sucess==true)
  35.                     {                                       
  36.                         parent.parent.reloadData();
  37.                         parent.parent.closeWindow();
  38.                         btn.setText("确定");
  39.                         btn.enable();                                           
  40.                     }else{
  41.                         btn.setText("确定");
  42.                         btn.enable();   
  43.                     }                   
  44.                   });   
  45.         }else return;
  46.         });     
  47.             }  
  48.         },{
  49.             text: '重置',
  50.              handler:function(){editPanel.form.reset();}
  51.         }]
  1. parent.parent.reloadData();
  2. parent.parent.closeWindow();

这两句首先reload 主面板main里面的gird,然后关闭两个弹出窗口 
关闭的实现在这里:
  1.  function closeWindow()
  2. {
  3.     if(true)
  4.     {       
  5.         xxxxOpenDialog.close();     
  6.     }   
  7. }
补充reloaddata的定义:

  1. reloadData=function(){
  2.             if(!searchPanel.form.isValid())return
  3.             var formLength=searchPanel.form.items.items.length;
  4.             var searchFilds=new Object();
  5.             searchFilds["start"]=0;
  6.             searchFilds["limit"]=pageSize;
  7.              for(var i=0;i<formLength;i+=1)
  8.              {
  9.                 var control=searchPanel.form.items.items[i];
  10.                 searchFilds[control.name]=control .getValue();
  11.                 //alert(control.name+" "+control .getValue());
  12.              }
  13.               grid_DataStore.load({params:searchFilds}); 
  14.     };
 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值