extjs 页面显示问题,困扰我太多天了,求大神指点

项目环境:用的是ssm框架,extjs3.0版本。
第一次点击“业绩加办账户”然后点击新建的时候窗口没有问题
图片说明
关闭“业绩加办账户”之后,在点开这个功能菜单,再点击新建就出现问题了
图片说明
只能刷新整个页面才能变回正常
我用的是grid和form组合,查询按钮和文本框的代码:
applyAccount.gridManager = new Ext.grid.GridPanel({
//title : '客户经理选取列表',
store : applyAccount.storeManager,
colModel : applyAccount.colModelManager,
bbar : applyAccount.CusBbar,
selModel : applyAccount.CusSelModel,
columnLines : true,//否显示列分割线,默认为false
autoScroll : 'auto',
autoSizeColumns : true,//根据列内容自动适应列宽度
viewConfig : {

forceFit : true
},

loadMask : true,
tbar : [

'客户经理编号:',{
  id : 'clientManagerNumP',
xtype : 'textfield'},'-',
{
            text : '查询',
iconCls : 'query',
handler : function() {
applyAccount.storeManager.load({

params: { start: 0,
limit: applyAccount.CusPageSize,
level:2,
managerNum:Ext.get('clientManagerNumP').dom.value
},
callback:function(store,resc){
var record2 = applyAccount.grid.getSelectionModel().getSelected();
if(record2){
var records = new Array();
applyAccount.storeManager.each(function(record){
if(record.data.account == record2.data.clientManagerNum){
records.push(record);
}
});
applyAccount.CusSelModel.selectRecords(records,true);
}
}

});
}
}]
});

弹出的window对象你配置autoDestroy是不是设置为false了?

下面是我这个页面的代码:在gridpanel和formpanel里面都没有设置autoDestroy属性,window对象里面也没有设置这个属性,设置了一下,好像还是不行。不知道是不是受其他页面影响的问题

Ext.QuickTips.init(); //yepnope("${ctx}/resources/js/applyClientBefore/applyClientBefore.js"); Ext.ns("Ext.Authority.applyAccount"); // 自定义一个命名空间 applyAccount = Ext.Authority.applyAccount; // 定义命名空间的别名 applyAccount = { all : ctx + '/applyAccount/queryBefore', // 所有 allClientManagerTotal : ctx + '/applyClient/allClientManagerTotal', save : ctx + "/applyAccount/saveApplyAccount",// 保存 del : ctx + "/applyAccount/delete/",// 删除 CustomAll : ctx + "/applyAccount/CustomAll", upLoad : ctx+"/applyAccount/upLoad", pageSize : 20// 每页显示的记录数 }; /** 改变页的combo*/ applyAccount.pageSizeCombo = new Share.pageSizeCombo({ value : '20', listeners : { select : function(comboBox) { applyAccount.pageSize = parseInt(comboBox.getValue()); applyAccount.bbar.pageSize = parseInt(comboBox.getValue()); applyAccount.store.baseParams.limit = applyAccount.pageSize; applyAccount.store.baseParams.start = 0; applyAccount.store.load(); } } }); //覆盖已经设置的。具体设置以当前页面的pageSizeCombo为准 applyAccount.pageSize = parseInt(applyAccount.pageSizeCombo.getValue()); /** 基本信息-数据源 */ applyAccount.store = new Ext.data.Store({ autoLoad:true, remoteSort : true, baseParams : { start : 0, limit : applyAccount.pageSize }, proxy : new Ext.data.HttpProxy({// 获取数据的方式 method : 'POST', url : applyAccount.all }), reader : new Ext.data.JsonReader({// 数据读取器 totalProperty : 'results', // 记录总数 root : 'rows' // Json中的列表数据根节点 }, ['accountNum', 'agencyNum', 'agencyName', 'clientManagerNum', 'clientManagerName', 'refPersonAccount', 'refPersonName', 'createPerson', 'createDate', 'clientName' ]), listeners : { 'load' : function(store, records, options) { applyAccount.alwaysFun(); } } }); //applyClientBefore.store.load(); /** 基本信息-选择模式 */ applyAccount.selModel = new Ext.grid.CheckboxSelectionModel({ header:'', singleSelect : true, listeners : { 'rowselect' : function(selectionModel, rowIndex, record) { applyAccount.deleteAction.enable(); applyAccount.editAction.enable(); }, 'rowdeselect' : function(selectionModel, rowIndex, record) { applyAccount.alwaysFun(); } } }); /** 基本信息-数据列 */ applyAccount.colModel = new Ext.grid.ColumnModel({ defaults : { sortable : true, align:'center', width : 110 }, columns : [ applyAccount.selModel, { header : '机构代码', dataIndex : 'agencyNum' }, { header : '账户号', dataIndex : 'accountNum' }, { header : '客户姓名', dataIndex : 'clientName', width : 150 }, { header : '客户经理编号', dataIndex : 'clientManagerNum' }, { header : '客户经理姓名', dataIndex : 'clientManagerName' }, { header : '推荐人编号', dataIndex : 'refPersonAccount' }, { header : '推荐人姓名', dataIndex : 'refPersonName' }, { header : '创建人', dataIndex : 'createPerson' }, { header : '创建时间', dataIndex : 'createDate', renderer: function(value) { return (new Date(value)).format("Y-m-d H:i:s"); }, width : 150 } ] }); /** 新建 */ applyAccount.addAction = new Ext.Action({ text : '新建', iconCls : 'field_add', handler : function() { applyAccount.alwaysFun(); applyAccount.tuiJianStore.load(); applyAccount.storeManager.load(); applyAccount.addWindow.setIconClass('field_add'); // 设置窗口的样式 applyAccount.addWindow.setTitle('新建'); // 设置窗口的名称 applyAccount.addWindow.show().center(); // 显示窗口 //applyClientBefore.commonFun(); applyAccount.fromPanel.getForm().reset(); Ext.get('refPersonNumq').dom.value=''; Ext.get('clientManagerNumP').dom.value=''; } }); /** 编辑 */ applyAccount.editAction = new Ext.Action({ text : '编辑', iconCls : 'field_edit', disabled : true, handler : function() { // applyClientBefore.commonFun(); var record = applyAccount.grid.getSelectionModel().getSelected(); applyAccount.tuiJianStore.load({ params: { start: 0, limit: applyAccount.TjPageSize, level:2, refPersonNum:record.data.refPersonAccount }, callback: function(records, options, success){ if(records.length==1){ applyAccount.TjSelModel.selectRecords(records,true); } } }); applyAccount.storeManager.load({ params: { start: 0, limit: applyAccount.CusPageSize, level:2, managerNum:record.data.clientManagerNum }, callback: function(records, options, success){ if(records.length==1){ applyAccount.CusSelModel.selectRecords(records,true); } } }); applyAccount.addWindow.setIconClass('field_edit'); // 设置窗口的样式 applyAccount.addWindow.setTitle('编辑'); // 设置窗口的名称 applyAccount.addWindow.show().center(); Ext.get('refPersonNumq').dom.value=record.data.refPersonAccount; Ext.get('clientManagerNumP').dom.value=record.data.clientManagerNum; applyAccount.fromPanel.getForm().findField('clientName').setValue(record.data.clientName); applyAccount.fromPanel.getForm().findField('accountNum').setValue(record.data.accountNum); //applyAccount.fromPanelEdit.getForm().findField('managerNumq').setValue(record.data.clientManagerNum); //applyAccount.fromPanelEdit.getForm().findField('refPersonNumq').setValue(record.data.refPersonAccount); //applyAccountBefore.fromPanel.getForm().findField('customerNumber').setValue(record.data.customerNumber); applyAccount.fromPanel.getForm().findField('validAcount').setValue(record.data.accountNum); applyAccount.fromPanel.getForm().findField('validAcountName').setValue(record.data.clientName); } }); /** 删除 */ applyAccount.deleteAction = new Ext.Action({ text : '删除', iconCls : 'field_delete', disabled : true, handler : function() { applyAccount.delFun(); } }); /** 批量导入 */ applyAccount.upLoadAction = new Ext.Action({ text : '批量导入', iconCls : 'icon_export', //disabled : true, handler : function() { applyAccount.applyAccountWin.show(); } }); /** 查询 */ applyAccount.searchField = new Ext.ux.form.SearchField({ store : applyAccount.store, paramName : 'clientName', emptyText : '请输入客户姓名', style : 'margin-left: 5px;' }); /** 顶部工具栏 */ applyAccount.tbar = [ applyAccount.addAction, '-', applyAccount.editAction,'-', applyAccount.searchField ]; /** 底部工具条 */ applyAccount.bbar = new Ext.PagingToolbar({ pageSize : applyAccount.pageSize, store : applyAccount.store, displayInfo : true, //plugins : new Ext.ux.ProgressBarPager(), // 分页进度条 items : [ '-', ' ', applyAccount.pageSizeCombo ] }); /** 基本信息-表格 */ applyAccount.grid = new Ext.grid.GridPanel({ store : applyAccount.store, colModel : applyAccount.colModel, selModel : applyAccount.selModel, tbar : applyAccount.tbar, bbar : applyAccount.bbar, autoScroll : 'auto', region : 'center', //autoExpandColumn :'remark', loadMask : true, viewConfig:{forceFit:true}, columnLines : true,//否显示列分割线,默认为false stripeRows : true }); /**批量导入start*/ applyAccount.uploadform = new Ext.form.FormPanel({ height : 90, fileUpload: true, frame:true, labelWidth: 60, defaults: { anchor: '90%', allowBlank: false // msgTarget: 'side' }, items: [{ xtype : 'button', text : '模板下载', style: { marginBottom: '10px' }, handler:function(){ var w=window.open(ctx + "/upload/加办关系模板.xls","_blank"); } },{ xtype: 'fileuploadfield', // id: 'file_uploadId', name: 'applyAccountFile', emptyText: '--请选择后缀名为.xls、.xlsx的文件--', fieldLabel: '文件上传', buttonText: '浏 览...', style: { marginBottom: '15px' } }] }); applyAccount.applyAccountWin=new Ext.Window({ layout : 'form', width : 360, height : 160, closeAction : 'hide', plain : true, modal : true, resizable : true, bodyStyle: 'padding: 2px 2px 2px 3px;boder:0', items : [applyAccount.uploadform], buttons : [ { text : '导入', handler : function() { if(applyAccount.uploadform.getForm().isValid()){ applyAccount.uploadform.getForm().submit({ accountValidation : true, method : 'POST', url: applyAccount.upLoad, waitMsg: '正在上传,请稍后', success:function(form, action) { var result=Ext.decode(action.response.responseText); Ext.Msg.alert('提示:', result.msg); applyAccount.store.reload(); applyAccount.applyAccountWin.hide(); form.reset(); }, failure : function(form, action) { Ext.Msg.alert('提示:', Ext.decode(action.response.responseText).msg); } }); } } }] }); /**批量导入end */ //客户经理 /** 改变页的combo*/ applyAccount.CusPageSizeCombo = new Share.pageSizeCombo({ value : '20', listeners : { select : function(comboBox) { applyAccount.CusPageSize = parseInt(comboBox.getValue()); applyAccount.CusBbar.pageSize = parseInt(comboBox.getValue()); applyAccount.storeManager.baseParams.limit = applyAccount.CusPageSize; applyAccount.storeManager.baseParams.start = 0; applyAccount.storeManager.load(); } } }); //覆盖已经设置的。具体设置以当前页面的pageSizeCombo为准 applyAccount.CusPageSize = parseInt(applyAccount.CusPageSizeCombo.getValue()); /** 基本信息-数据源 */ applyAccount.storeManager = new Ext.data.Store({ remoteSort : true, autoLoad:false, baseParams : { start : 0, limit : applyAccount.CusPageSize, level : 2 }, proxy : new Ext.data.HttpProxy({// 获取数据的方式 method : 'POST', url : applyAccount.CustomAll }), reader : new Ext.data.JsonReader({// 数据读取器 totalProperty : 'results', // 记录总数 root : 'rows' // Json中的列表数据根节点 }, ['account', 'realName' ]) }); /** 基本信息-选择模式 */ applyAccount.CusSelModel = new Ext.grid.CheckboxSelectionModel({ header:'', singleSelect : true, listeners : { 'rowselect' : function(selectionModel, rowIndex, record) { }, 'rowdeselect' : function(selectionModel, rowIndex, record) { } } }); applyAccount.colModelManager = new Ext.grid.ColumnModel({ defaults : { sortable : true, align:'center'//, width : 110 }, columns : [applyAccount.CusSelModel,{ header : '客户经理编号', dataIndex : 'account' }, { header : '客户经理姓名', dataIndex : 'realName' } ] }); /** 底部工具条 */ applyAccount.CusBbar = new Ext.PagingToolbar({ pageSize : applyAccount.CusPageSize, store : applyAccount.storeManager, displayInfo : false, //plugins : new Ext.ux.ProgressBarPager(), // 分页进度条 items : [ '-', ' ', applyAccount.CusPageSizeCombo ] }); applyAccount.gridManager = new Ext.grid.GridPanel({ //title : '客户经理选取列表', store : applyAccount.storeManager, colModel : applyAccount.colModelManager, bbar : applyAccount.CusBbar, selModel : applyAccount.CusSelModel, columnLines : true,//否显示列分割线,默认为false autoScroll : 'auto', autoSizeColumns : true,//根据列内容自动适应列宽度 viewConfig : { forceFit : true }, loadMask : true, tbar : [ '客户经理编号:',{   id : 'clientManagerNumP', xtype : 'textfield'},'-', {             text : '查询', iconCls : 'query', handler : function() { applyAccount.storeManager.load({ params: { start: 0, limit: applyAccount.CusPageSize, level:2, managerNum:Ext.get('clientManagerNumP').dom.value }, callback:function(store,resc){ var record2 = applyAccount.grid.getSelectionModel().getSelected(); if(record2){ var records = new Array(); applyAccount.storeManager.each(function(record){ if(record.data.account == record2.data.clientManagerNum){ records.push(record); } }); applyAccount.CusSelModel.selectRecords(records,true); } } }); } }] }); //推荐人 /** 改变页的combo*/ applyAccount.TjPageSizeCombo = new Share.pageSizeCombo({ value : '20', listeners : { select : function(comboBox) { applyAccount.TjPageSize = parseInt(comboBox.getValue()); applyAccount.TjBbar.pageSize = parseInt(comboBox.getValue()); applyAccount.tuiJianStore.baseParams.limit = applyAccount.TjPageSize; applyAccount.tuiJianStore.baseParams.start = 0; applyAccount.tuiJianStore.load(); } } }); //覆盖已经设置的。具体设置以当前页面的pageSizeCombo为准 applyAccount.TjPageSize = parseInt(applyAccount.TjPageSizeCombo.getValue()); /** 基本信息-数据源 */ applyAccount.tuiJianStore = new Ext.data.Store({ remoteSort : true, autoLoad:false, baseParams : { start : 0, limit : applyAccount.TjPageSize, level : 2 }, proxy : new Ext.data.HttpProxy({// 获取数据的方式 method : 'POST', url : applyAccount.CustomAll }), reader : new Ext.data.JsonReader({// 数据读取器 totalProperty : 'results', // 记录总数 root : 'rows' // Json中的列表数据根节点 }, ['account', 'realName' ]) }); /** 底部工具条 */ applyAccount.TjBbar = new Ext.PagingToolbar({ pageSize : applyAccount.TjPageSize, store : applyAccount.tuiJianStore, displayInfo : false, //plugins : new Ext.ux.ProgressBarPager(), // 分页进度条 items : [ '-', ' ', applyAccount.TjPageSizeCombo ] }); /** 基本信息-选择模式 */ applyAccount.TjSelModel = new Ext.grid.CheckboxSelectionModel({ header:'', singleSelect : true, listeners : { 'rowselect' : function(selectionModel, rowIndex, record) { }, 'rowdeselect' : function(selectionModel, rowIndex, record) { } } }); applyAccount.colModelTuiJian = new Ext.grid.ColumnModel({ defaults : { sortable : true, align:'center'//, width : 110 }, columns : [applyAccount.TjSelModel,{ header : '推荐人编号', dataIndex : 'account' }, { header : '推荐人姓名', dataIndex : 'realName' } ] }); applyAccount.tuiJianGrid = new Ext.grid.GridPanel({ //title : '推荐人选取列表', store : applyAccount.tuiJianStore, colModel : applyAccount.colModelTuiJian, bbar : applyAccount.TjBbar, selModel : applyAccount.TjSelModel, columnLines : true,//否显示列分割线,默认为false autoScroll : 'auto', viewConfig : { forceFit : true }, autoSizeColumns : true,//根据列内容自动适应列宽度 loadMask : true, tbar : [ '推荐人编号:',{   id : 'refPersonNumq', xtype : 'textfield'},'-', {             text : '查询', iconCls : 'query', handler : function() { applyAccount.tuiJianStore.load({ params: { start: 0, limit: applyAccount.TjPageSize, level:2, refPersonNum:Ext.get('refPersonNumq').dom.value }, callback:function(store){ var record2 = applyAccount.grid.getSelectionModel().getSelected(); if(record2){ var records = new Array(); applyAccount.tuiJianStore.each(function(record){ if(record.data.account == record2.data.refPersonAccount){ records.push(record); } }); applyAccount.TjSelModel.selectRecords(records,true); } } }); } }] }); // applyAccount.fromPanel = new Ext.form.FormPanel({ frame : true, title : '', labelAlign: 'right', bodyStyle : 'padding:10px;border:0px', labelwidth : 70, items:[ { xtype : 'textfield', fieldLabel : 'validAcount', hidden:true, name:'validAcount', //name : 'remark', anchor : '40%' },{ xtype : 'textfield', fieldLabel : 'validAcountName', hidden:true, name:'validAcountName', //name : 'remark', anchor : '40%' },{ autoHeight:true, layout:'column', border:false, allowBlank : false, items: [{ columnWidth:.33, layout:'form', defaults: {anchor: '95%'}, style: 'margin-left: 5px;padding-left: 5px;', items:[ {xtype: 'textfield', fieldLabel: '客户姓名', allowBlank :false, name: 'clientName' } ] }, { columnWidth:.33, layout:'form', defaults: {anchor: '95%'}, style: 'margin-left: 5px;padding-left: 5px;', items:[ {xtype: 'textfield', fieldLabel: '帐户号', allowBlank :false, name: 'accountNum' } ] } ] } ] }); /** 编辑新建窗口 */ applyAccount.addWindow = new Ext.Window({ layout : 'border', width : 800, height : 400, closeAction : 'hide', plain : true, modal : true, resizable : true, items : [ { region: "north", height:50,border: false,items:[applyAccount.fromPanel] }, { region: "center", split: true, layout:'fit', border: true,items:[applyAccount.gridManager] }, { region: "east", width: 400,layout:'fit', items:[applyAccount.tuiJianGrid] } ], buttons : [ { text : '保存', handler : function() { applyAccount.saveFun(); } }, { text : '重置', handler : function() { applyAccount.commonFun(); } } ] }); applyAccount.alwaysFun = function() { Share.resetGrid(applyAccount.grid); applyAccount.deleteAction.disable(); applyAccount.editAction.disable(); }; applyAccount.commonFun = function(){ applyAccount.fromPanel.getForm().reset(); Share.resetGrid(applyAccount.tuiJianGrid); Share.resetGrid(applyAccount.gridManager); } applyAccount.saveFun = function() { var form = applyAccount.fromPanel.getForm(); //var acount = form.findField('customerNumber').getValue(); //var acountName=form.findField('customerName').getValue(); var clientName=form.findField('clientName').getValue(); var accountNum=form.findField('accountNum').getValue(); var manageRecord = applyAccount.gridManager.getSelectionModel().getSelected(); var tuiJianRecord = applyAccount.tuiJianGrid.getSelectionModel().getSelected(); var validAcount = form.findField('validAcount').getValue(); var validAcountName = form.findField('validAcountName').getValue(); var vaAcount; if(validAcount!=accountNum||validAcountName!=clientName){ vaAcount="1"; }else{ vaAcount="2"; } if(clientName==''||accountNum==''){ Ext.MessageBox.show({ title: '提示信息', msg: '请输入客户姓名和账户号', buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO }); return; } if(manageRecord){//判断是否选择客户经理列表 var manageNum=manageRecord.data.account; var manageName=manageRecord.data.realName; var tuiJianNum=""; var tuiJianName=""; if(tuiJianRecord){ tuiJianNum=tuiJianRecord.data.account; tuiJianName=tuiJianRecord.data.realName; } Share.AjaxRequest({ url : applyAccount.save, params : {accountNum:accountNum, //acount:acount, clientName:clientName, //customerNumber:customerNumber, manageNum:manageNum, manageName:manageName, tuiJianNum:tuiJianNum, tuiJianName:tuiJianName, // reType:reType, updateAccount:vaAcount }, callback : function(json) { applyAccount.addWindow.hide(); applyAccount.alwaysFun(); applyAccount.store.reload(); } }); }else{ //Ext.Msg.alert('系统提示:','请选择客户经理编号'); Ext.MessageBox.show({ title: '提示信息', msg: '请选择客户经理编号', buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO }); return; } //if (!form.isValid()) { // return; //} // 发送请求 }; applyAccount.myPanel = new Ext.Panel({ id : '${param.id}' + '_panel', renderTo : '${param.id}', layout : 'border', boder : false, height : index.tabPanel.getInnerHeight() - 1, items : [ applyAccount.grid ] });

去这里贴下代码,完整的,你这个没个刷过没发看
http://bbs.csdn.net/topics/391856670