extjs页面显示问题,困扰我很多天了,请朋友们指点一下!

ljstudyeo 2015-11-10 03:13:50
项目环境:SSM框架,extjs3.0版本
第一次点击新建的时候窗口没有问题,如下图:

关闭“业绩加办账户”之后,在点开这个菜单,再点击新建就出现问题了

这个window组件包含了gridpanel(查询和列表显示)和formpanel(上面的两个文本框)两个组件
出问题的部分是gridpanel,代码如下:
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 : [
'客户经理编号:',{
xtype: 'textfield',
//fieldLabel: '客户姓名',
allowBlank :false,
id: 'accountManager'
},
{
            text : '查询',
iconCls : 'query',
handler : function() {
//alert(Ext.get('accountManager').getValue());
applyAccount.storeManager.load({
params: { start: 0,
limit: applyAccount.CusPageSize,
level:2,
managerNum:Ext.get('accountManager').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);
}
}
});
}
}]
});
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 : [
'推荐人编号:',
{
xtype: 'textfield',
//fieldLabel: '客户姓名',
allowBlank :false,
id: 'refaccount'
},
{
            text : '查询',
iconCls : 'query',
handler : function() {
applyAccount.tuiJianStore.load({
params: { start: 0,
limit: applyAccount.TjPageSize,
level:2,
refPersonNum:Ext.get('refaccount').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();
}
} ]
});

...全文
351 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ljstudyeo 2015-11-12
  • 打赏
  • 举报
回复
把搜索文本框的id属性改成name属性可以吗?改了之后点击编辑的时候怎么自动给文本框里面赋值呢? 原来的编辑组件是: 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.fromPanel.getForm().findField('validAcount').setValue(record.data.accountNum); applyAccount.fromPanel.getForm().findField('validAcountName').setValue(record.data.clientName); } });
scatking 2015-11-11
  • 打赏
  • 举报
回复
tbar不要直接放text和button,放Ext.Toolbar,xtype是toolbar。toolbar里再放文本框和按钮。
  • 打赏
  • 举报
回复
发代码全来,好测试。就这些代码,调用applyAccount.addWindow.show(),applyAccount.addWindow.hide()来回显示隐藏在ext3.0下没有出现你说的问题

87,991

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧