tabpanel的中元素显示问题
hmily3913
2008-05-08
下面是一个编辑界面,先LOAD已经有的数据,然后对整个FORM进行编辑提交,问题一PANEL部分元素不能正常显示,如果加上DOLAYOUT(),值又不能显示,重新LOAD,编辑过的东西又没有了,代码如下 (部分代码省略掉了)
var Triggergen=new Ext.form.TriggerField({fieldLabel: '计划员',name :'ima67',allowBlank:true,width:140,triggerClass:'x-form-search-trigger'}); Triggergen.onTriggerClick = function(){ //采购员 var storegen=new Ext.data.Store({ proxy: new Ext.data.ScriptTagProxy({url:'/erp/servlet/EasyTable_edit?Submitname=getData'}), reader: new Ext.data.JsonReader({totalProperty:'totalProperty', root:'root'},[{name: 'gen01'},{name: 'gen02'},{name: 'sel'}]), baseParams:{dbColumn:"gen_file,gen01 asc,gen01,gen02"} }); storegen.load({params:{start:0,limit:20}}); Ext.global.simpTrigger(Triggergen,storegen,"gen01","gen02","采购员"); }; var formPanel = new Ext.form.FormPanel({ baseCls: 'x-plain', labelWidth: 80, width:798, height:490, frame :true, url:"/erp/servlet/EasyTable_edit_commonControl", reader: new Ext.data.JsonReader({ root: 'results' }, ['ima01','ima02','ima021','ima06','ima08','ima05','ima03','ima70','ima55','ima55_fac','ima10','ima56','ima561','ima562','ima59','ima60','ima61','ima62','ima58','ima67','ima68','ima69','ima63','ima63_fac','ima108','ima64','ima641'] ), items: [{ layout:'column', border:false, items:[{ columnWidth:.5,layout: 'form',border:false, items: [ {xtype:'textfield',id: 'ima01',fieldLabel: '物料编号',name: 'ima01',height:20,allowBlank:false, anchor:'50%',maxLength:20,readOnly :true}, {xtype:'textfield',fieldLabel: '产品名称',name: 'ima02',height:20,anchor:'90%',maxLength:30,readOnly :true} ] }] },{ xtype:'tabpanel',plain:true,activeTab: 1,height:360,defaults:{bodyStyle:'padding:10px'}, items:[{ title:'工单/发料', layout:'column', border:false, // listeners: { // activate: this.doLayout() // }, items: [{ columnWidth:.4,layout: 'form',border:false,frame:true,labelWidth :120, items: [ {xtype:'combo',store: storegfe,fieldLabel: '发料单位', loadingText:'正在加载...', displayField:'descp',valueField:'value', mode:'local',triggerAction:'all', forceSelection :true, hiddenName:'ima63', emptyText:'请选择...',editable:true,allowBlank:true,width:100, maxHeight:100, tabIndex:4}, {xtype:'numberfield',fieldLabel: '发料/库存单位换算',name: 'ima63_fac',width: 100,maxLength:16,decimalPrecision:8,value:'0.000'}, { layout:'column',border:false, items:[{ columnWidth:.6,layout: 'form',border:false,items: [{fieldLabel: '发料前调拨',xtype:'radio',name: 'ima108',inputValue:'Y',checked :false,boxLabel:'是'}] },{ columnWidth:.3,layout: 'form',border:false,labelWidth:0,labelSeparator:'',hideLabels:true,items: [{fieldLabel: '',xtype:'radio',name: 'ima108',inputValue:'N',checked :true,boxLabel:'否'}] }] }, {xtype:'numberfield',fieldLabel: '发料单位批量',name: 'ima64',width: 100,maxLength:16,decimalPrecision:8,value:'0.000'}, {xtype:'numberfield',fieldLabel: '最少发料数量',name: 'ima641',width: 100,maxLength:15,decimalPrecision:3,value:'0.000'}] }] },{ title:'计划/前置时间', layout:'column', border:false, items: [{ columnWidth:.4,layout: 'form',border:false,frame:true,labelWidth :120, items: [ Triggergen, {xtype:'numberfield',fieldLabel: '需求时距',name: 'ima68',width: 100,maxLength:9,decimalPrecision:3,value:'0.000'}, {xtype:'numberfield',fieldLabel: '计划时距',name: 'ima69',width: 100,maxLength:9,decimalPrecision:3,value:'0.000'} ] } ] }] }] }); 现在我让activeTab: 1,这样第一个panel里面就显示空白了,如果再后面加上下面代码,之前LOAD的值又不会显示 formPanel.findByType("tabpanel")[0].on('tabchange',function(tp,p){ p.doLayout(); // formPanel.form.load({ // method :"GET", // url:"/erp/servlet/EasyTable_edit?Submitname=getInfo&dbColumn=ima_file,ima01&columnValue="+id+"&backInfo=ima01,ima02,ima021,ima06,ima08,ima05,ima03,ima70,ima55,ima55_fac,ima10,ima56,ima561,ima562,ima59,ima60,ima61,ima62,ima58,ima67,ima68,ima69,ima63,ima63_fac,ima108,ima64,ima641", // waitMsg:'加载中...'}); }); 不知道该如何解决啊,请大家指点下,谢谢 |
|
tempture
2008-05-09
xtype:'tabpanel',
deferredRender :true, layoutOnTabChange :true |
|
hmily3913
2008-05-09
加上layoutOnTabChange :true就可以了,先谢谢,刚开始用EXT,哎,好多不明白的!还是上面的代码,里面有个Triggergen=new Ext.form.TriggerField,如果在LOAD的时候如果active:0,而Triggergen在panel 1中,这个TriggerField就不能被赋值,这个又是什么原因呢?
|