欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基于ExtJs在頁面上window再調用Window的事件處理方法

 更新時間:2017年07月26日 09:34:12   投稿:jingxian  
下面小編就為大家?guī)硪黄贓xtJs在頁面上window再調用Window的事件處理方法。小編覺得挺不錯的,現在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

今天在開發(fā)Ext的過程中遇到了一個惡心的問題,就是在ext.window頁面,點擊再次彈出window時,gridpanel中的store數據加載異常,不能正常被加載,會出現緩存,出現該問題,是因為window窗口彈出時,兩個window同時存在,并且在兩個window交替使用時,需要先將一個窗口關閉,關閉時,會對window的緩存進行清理,這樣就能保證store數據的正確加載。分享給大家,供參考。

var actInfoWindow2;
function showCallFlowInfoWindow(flowid, actId) {
  var actWindowHeight1 = window.innerHeight
  || document.documentElement.clientHeight
  || document.body.clientHeight;
  if(null != upldWin && undefined != upldWin && "" != upldWin){
    upldWin.close();
  }
  // 異?;顒幽P?
  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 = { 
          //參數 
          flowId : flowid,
          id : actId
        }; 
        Ext.apply(store.proxy.extraParams, params); 
      } 
    } 
  });
   
  // 綁定數據模型flowColumns
  var callFlowColumns = [
    { text: '實例名', dataIndex: 'instance', width:174 },
    { text: '工程名', dataIndex: 'prjName',width: 174 },
    { text: '工作流名', dataIndex: 'flowName',width: 174 },
    { text: '啟動時間', 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 : " 數據加載中,請稍等 "
    }
  });
   
  if (actInfoWindow2 == undefined || !actInfoWindow2.isVisible()) {
    actInfoWindow2 = Ext.create('Ext.window.Window', {
      id : 'actInfoWindow2',
      title : '活動信息詳情',
      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();
}

我的問題出現就是因為沒有添加上面黃色背景的代碼片段導致的錯誤。供大家參考。兩個window交替使用時,需要交替關閉,這樣才能保證頁面的正常。ExtJs不建議彈出多window同時使用,當然,如果能解決好ExtJs之間的數據交互,也未必不可以。

以上這篇基于ExtJs在頁面上window再調用Window的事件處理方法就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

您可能感興趣的文章:

相關文章

最新評論