ExtJS Event handling for window on page

Source: Internet
Author: User

Today, in the process of developing EXT, I encountered a disgusting problem, is in the Ext.window page, click on the popup window again, Gridpanel in the store data load exception, can not be loaded, the cache will appear, this problem occurs because the Windows window pops up, two windows simultaneously, and in the two window alternate use, you need to first When a window is closed, the cache of the window is cleaned to ensure proper loading of the store data. Share to everyone for reference.

var actinfowindow2;function showcallflowinfowindow (Flowid, Actid) {var actWindowHeight1 = window.innerheight| | document.documentelement.clientheight| | Document.body.clientHeight;if (null! = Upldwin && undefined! = Upldwin && ""! = Upldwin) {upldwin.close ();}Abnormal activity Model 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 ', p Roxy: {type: ' ajax ', url: ' subflow.do ', reader: {type: ' json ', Root: ' Callflowlist ', Totalproperty: ' Total '}, Li              Steners: {' beforeload ': function (Store, OP, Options) {var params = {//Parameter              Flowid:flowid, Id:actid};           Ext.apply (store.proxy.extraParams, params);  }});//Bind data Model Flowcolumnsvar Callflowcolumns = [{text: ' Instance name ', Dataindex: ' instance ', width:174}, {text: ' Project name ', Dataindex: ' Prjname ', width:174}, {text: ' Workflow name ', Dataindex: ' Flowname ', width:174}, {text: ' Start time ', Da Taindex: ' 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: "Data loading, please Wait"}}); if (ActInfoWindow2 = = Undefined | |! Actinfowindow2.isvisible ()) {actInfoWindow2 = ext.create (' Ext.window.Window ', {id: ' ActInfoWindow2 ', Title: ' Event information details ', 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(); }

My problem arises because there are no errors caused by the code snippet with the yellow background above. For everyone's reference. When the two window is used alternately, it needs to be switched off to ensure that the page is normal. ExtJS is not recommended to pop up multiple windows at the same time, of course, if you can solve the extjs between the data interaction, it may not be.

ExtJS Event handling for window on page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.