ext window 速度优化
来源:互联网 发布:互联网寒冬 知乎 编辑:程序博客网 时间:2024/05/21 14:49
关闭时,尽量使用hide事件,把new Ext.Window()设置为全局对象,在要调用 的界面进行创建一次后,把创建对象变量保存起来,以便下次使用,只对数据做操作。
CPC.WFBILL = Ext.extend(CPC.BaseForm,{
selm:null,
procs:null,
ClassName: null,
formclass:null,
init: function(){
CPC.WFBILL.superclass.init.call(this);
try {
var objconf={};
if(this.procs)
objconf = {operright:this.procs.operright};
this.billObj=null;
if(this.formclass != null){
this.billObj= this.formclass;
}else{
this.billObj= eval('new '+this.ClassName+'(objconf)');
}
}catch(e){alert("脚本加载失败,请检查网络连接或刷新浏览器!"+e.message)}
var panel=this.billObj.getPanel();
var bh=document.body.clientHeight*0.9;
if(bh<500)bh=500;
this.win=new Ext.Window({
//width:920,
////modify by daiwei. 2011-05-23.修改点击单据号弹出框宽度.
width:'90%',//mainForm.tabPanel.getSize().width-120,
maximizable:true,
animateTarget:true,
draggable:false,
expandOnShow:false,
monitorResize:false,
resizable:false,
//maximized:true,
height: 570,
title: this.selm.get('objname'),
layout:'fit',
modal:true,
buttons:[{text:'取 消',scope:this,handler:function(){this.win.hide()}}],
items:panel,
closeAction:'hide',
listeners : {
scope : this,
'beforeshow' : function(a,b) {
if(this.formclass == null){
this.billObj.is_billwf=true;
this.billObj.selectFirstRow =true;
this.billObj.setSqlWhere(this.billObj.pkFieldName+"= "+ this.selm.get('objid'));
this.billObj.search();
}
},/*'show':function(){
billObj.panel.setActiveTab(billObj.wfPanel);
},*/'maximize':function(win){
win.doLayout();
},'hide':function(){
if (this.callback)
this.callback.call(this);
}
}
});
if(panel.topToolbar)
this.disableBar(panel.topToolbar)
},
search_data:function(ClassName,selm,formclass){
var wftempid_new=selm.data['wftempid'];
var wftempid_old=this.selm.data['wftempid'];
this.ClassName = ClassName;
this.selm =selm;
this.formclass=formclass;
this.win.setTitle(this.selm.get('objname'));
if(wftempid_new != wftempid_old || this.formclass != null){
try {
var objconf={};
if(this.procs)
objconf = {operright:this.procs.operright};
this.billObj=null;
if(this.formclass != null){
this.billObj= this.formclass;
}else{
this.billObj= eval('new '+this.ClassName+'(objconf)');
}
}catch(e){alert("脚本加载失败,请检查网络连接或刷新浏览器!"+e.message)}
var panel=this.billObj.getPanel();
this.win.remove(this.win.items.items[0]);
this.win.add(panel);
this.win.doLayout();
}
},
//禁用工具栏按钮
disableBar: function(bbar){
if(bbar.items){
bbar.items.each(function(button) {
if(button.setDisabled)
button.setDisabled(true);
}, this);
}else{
for (var i = 0; i < bbar.length; i++) {
if(bbar[i].setDisabled)bbar[i].setDisabled(true);
}
}
},
getPanel: function(){
return this.win;
});
调用对象方法:
var self = this;
if(typeof this.wfbill == 'undefined'){
this.wfbill = new CPC.WFBILL({
ClassName : confobj.formclass,
selm : selm,
formclass:formclass,
callback:function(){
self.refresh2();
}
});
}else{
this.wfbill.search_data(confobj.formclass,selm,formclass);
}
this.wfbill.getPanel().show();
- ext window 速度优化
- Ext.Window
- ext--window
- Ext.Window+Ext.grid.GridPanel
- Ext.Window Ext.Panel Ext.TabPanel
- ext window 的问题
- EXT.Window学习
- Ext.Window重新构建
- Ext的window布局
- ext window close() 问题
- EXT UI window
- 两个Ext.window问题
- ext window窗口
- Ext.Window组件
- Ext.Window实践
- Ext.Window 学习示例
- ext window事件
- ExtJS(3)--Ext.Window
- BP算法介绍
- c# - 如何将用户加入Administrators Group
- magento invalid backend model specified giftmessage entity attribute backend boolean config
- 关于float /double、string类型的hash函数/hash表实现
- 楊受成唔識劉浩龍:居心叵測!
- ext window 速度优化
- 商业银行IT系统架构规划
- 红帽子下的防火墙的开启与关闭
- AE9.3升级到10.0(ArcGIS version not specified. You must call RuntimeManager.)
- 对View组件布局和绘制过程, 以及Drawable绘制的理解
- jQuery基础教程之强大的选择器(过滤选择器-可见性过滤选择器)
- android按键功能的拓展
- Java的反编译代码~哪位大神可以赐教一下?
- jquery中大于号的作用