亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

基于ExtJs在頁(yè)面上window再調(diào)用Window的事件處理方法

 更新時(shí)間:2017年07月26日 09:34:12   投稿:jingxian  
下面小編就為大家?guī)?lái)一篇基于ExtJs在頁(yè)面上window再調(diào)用Window的事件處理方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧

今天在開(kāi)發(fā)Ext的過(guò)程中遇到了一個(gè)惡心的問(wèn)題,就是在ext.window頁(yè)面,點(diǎn)擊再次彈出window時(shí),gridpanel中的store數(shù)據(jù)加載異常,不能正常被加載,會(huì)出現(xiàn)緩存,出現(xiàn)該問(wèn)題,是因?yàn)閣indow窗口彈出時(shí),兩個(gè)window同時(shí)存在,并且在兩個(gè)window交替使用時(shí),需要先將一個(gè)窗口關(guān)閉,關(guān)閉時(shí),會(huì)對(duì)window的緩存進(jìn)行清理,這樣就能保證store數(shù)據(jù)的正確加載。分享給大家,供參考。

var actInfoWindow2;
function showCallFlowInfoWindow(flowid, actId) {
  var actWindowHeight1 = window.innerHeight
  || document.documentElement.clientHeight
  || document.body.clientHeight;
  if(null != upldWin && undefined != upldWin && "" != upldWin){
    upldWin.close();
  }
  // 異常活動(dòng)模型
  Ext.define('callFlowModel', {
    extend: 'Ext.data.Model',
    fields: [{name: 'instance', type: 'string'},
         {name: 'flowName', type: 'string'},
         {name: 'prjName', type: 'string'},
         {name: 'startTime',  type: 'String'}]
  });
   
  callFlowStore = Ext.create('Ext.data.Store', {
    autoLoad : true,
    model : 'callFlowModel',
    proxy : {
      type : 'ajax',
      url : 'subflow.do',
      reader : {
        type : 'json',
        root : 'callFlowList',
        totalProperty : 'total'
      }
    }, 
    listeners: { 
      'beforeload': function (store, op, options) {
        var params = { 
          //參數(shù) 
          flowId : flowid,
          id : actId
        }; 
        Ext.apply(store.proxy.extraParams, params); 
      } 
    } 
  });
   
  // 綁定數(shù)據(jù)模型flowColumns
  var callFlowColumns = [
    { text: '實(shí)例名', dataIndex: 'instance', width:174 },
    { text: '工程名', dataIndex: 'prjName',width: 174 },
    { text: '工作流名', dataIndex: 'flowName',width: 174 },
    { text: '啟動(dòng)時(shí)間', dataIndex: 'startTime',width: 174 }
  ];
 
  callFlowGrid = Ext.create('Ext.grid.Panel', {
    region : 'center',
    //tbar:querybar,
    id:'callFlowList',
    autoScroll : false,
    border:false,
    //columnLines : true,
    //selModel:selModel,
    //bbar : pageBar,
    columns : callFlowColumns,
    store : callFlowStore,
    loadMask : {
      msg : " 數(shù)據(jù)加載中,請(qǐng)稍等 "
    }
  });
   
  if (actInfoWindow2 == undefined || !actInfoWindow2.isVisible()) {
    actInfoWindow2 = Ext.create('Ext.window.Window', {
      id : 'actInfoWindow2',
      title : '活動(dòng)信息詳情',
      modal : true,
      closeAction : 'destroy',
      constrain : true,
      autoScroll : true,
      width : 700,
      height : actWindowHeight1 - 300,
      items : [ callFlowGrid ],
      listeners:{
         beforeclose:function(){
           actInfoWindow2.destroy();
         }
      }
    });
  }
  actInfoWindow2.show();
}
if(null != upldWin && undefined != upldWin && "" != upldWin){

  upldWin.close();
}

我的問(wèn)題出現(xiàn)就是因?yàn)闆](méi)有添加上面黃色背景的代碼片段導(dǎo)致的錯(cuò)誤。供大家參考。兩個(gè)window交替使用時(shí),需要交替關(guān)閉,這樣才能保證頁(yè)面的正常。ExtJs不建議彈出多window同時(shí)使用,當(dāng)然,如果能解決好ExtJs之間的數(shù)據(jù)交互,也未必不可以。

以上這篇基于ExtJs在頁(yè)面上window再調(diào)用Window的事件處理方法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

您可能感興趣的文章:

相關(guān)文章

最新評(píng)論