博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
extjs combobox column布局为什么折叠在一起
阅读量:5825 次
发布时间:2019-06-18

本文共 6716 字,大约阅读时间需要 22 分钟。

以下是代码:

extjs libriry 3.3.1

/** * 人员基本信息查询Form *///--------------------------Combobox MyComboBox=Ext.extend(Ext.form.ComboBox,{	     fieldLabel:null,	     value:null,	     triggerAction:"all",	     displayField:"key",	     editable:false,	     name:null,	     id:null,	     url:null,	     hiddenName:'value',	     valueField:"value",	     autoLoad:null,	     mode:null,	     store:null,	     width:127,    	 constructor:function(conf){         //给以上参数赋值         this.fieldLabel=conf.fieldLabel;         this.value=conf.value;         this.name=conf.name;         this.id=conf.id;         this.url=(typeof conf.url) !='undefined'? conf.url : null;         this.mode=(typeof conf.mode) !='undefined'? conf.mode : 'remote';         this.valueField=(typeof conf.valueField) !='undefined'? conf.valueField : this.valueField;         this.displayField=(typeof conf.displayField) !='undefined'? conf.displayField : this.displayField;         this.width=(typeof conf.width) !='undefined'? conf.width : this.width;         this.autoLoad=conf.autoLoad;                  //store         if(conf.flag!=0){//非0即真         this.store=conf.store;	          }else{        	 this.store=new Ext.data.JsonStore({        		 idProperty: 'value',    	    	 autoLoad:this.autoLoad,    	    	 url:this.url,    	    	 fields:[{name:'key'},{name:"value"}]    	     });         }                                 //构造         MyComboBox.superclass.constructor.call(this,{        	    fieldLabel:this.fieldLabel,				value:this.value,				triggerAction:this.triggerAction,			    displayField:this.displayField,			    editable:this.editable,			    valueField:this.valueField,			    name:this.name,			    id:this.id,			    hiddenName:this.hiddenName,			    store:this.store,			    width:this.width,			    mode:this.mode		 });         	 } });  //--------------------------FORMUserBasicInfoTopForm=Ext.extend(Ext.form.FormPanel,{	yearCbo:null,//年份cbo	medicalCompanyCbo:null,//医疗服务单位cbo	//构造方法	constructor:function(){		//intialization year combobox 		this.initYearCbo();		//		this.initMedicalCompanyCbo();				UserBasicInfoTopForm.superclass.constructor.call(this,{		     region:'north',//位于北边		     collapsible:true,//是否可以最小		     //collapsedTitle: true,		     height:80,		     title:'人员基本信息查询条件',		     minSize:50,//最小只能拖到50		     maxSize:120,//最大120			 items: [{//a begin		         xtype : "panel",			     layout : "column",			     border : false,	        	 items:[						{					    xtype:"panel",					    layout:'form',					    border:false,					    width:130,					    labelWidth:55,					    items:[this.yearCbo]					    },					    {						    xtype:"panel",						    layout:'form',						    border:false,						    width:200,						    labelWidth:55,						    items:[this.medicalCompanyCbo]						}	        	       ]			 }]		});	},	//---初始化年度的 Cbo you know	initYearCbo:function(){		 this.yearCbo=new MyComboBox({			 fieldLabel:"报销类型",			 value:"",			 name:"dbyear",			 id:"dbyear",			 url:"/himp/user_basic_info!queryYearListAjax.action",			 autoLoad:true,			 flag:0,			 width:70			 });	},	//初始化医疗服务单位cbo orgCode	initMedicalCompanyCbo:function(){		 this.medicalCompanyCbo=new MyComboBox({			 fieldLabel:"报销类型",			 value:"",			 name:"dbyear",			 id:"dbyear",			 url:"/himp/user_basic_info!queryMedicalUnitAjax.action",			 autoLoad:true,			 flag:0,			 width:140			 });		}});
看出来错误没有,其实是在我copy的时候犯的错误,因为这两个combobox的id是一样的,更改不同的id就好了,

之前的图

修改代码:

/** * 人员基本信息查询Form *///--------------------------Combobox MyComboBox=Ext.extend(Ext.form.ComboBox,{	     fieldLabel:null,	     value:null,	     triggerAction:"all",	     displayField:"key",	     editable:false,	     name:null,	     id:null,	     url:null,	     hiddenName:'value',	     valueField:"value",	     autoLoad:null,	     mode:null,	     store:null,	     width:127,    	 constructor:function(conf){         //给以上参数赋值         this.fieldLabel=conf.fieldLabel;         this.value=conf.value;         this.name=conf.name;         this.id=conf.id;         this.url=(typeof conf.url) !='undefined'? conf.url : null;         this.mode=(typeof conf.mode) !='undefined'? conf.mode : 'remote';         this.valueField=(typeof conf.valueField) !='undefined'? conf.valueField : this.valueField;         this.displayField=(typeof conf.displayField) !='undefined'? conf.displayField : this.displayField;         this.width=(typeof conf.width) !='undefined'? conf.width : this.width;         this.autoLoad=conf.autoLoad;                  //store         if(conf.flag!=0){//非0即真         this.store=conf.store;	          }else{        	 this.store=new Ext.data.JsonStore({        		 idProperty: 'value',    	    	 autoLoad:this.autoLoad,    	    	 url:this.url,    	    	 fields:[{name:'key'},{name:"value"}]    	     });         }                                 //构造         MyComboBox.superclass.constructor.call(this,{        	    fieldLabel:this.fieldLabel,				value:this.value,				triggerAction:this.triggerAction,			    displayField:this.displayField,			    editable:this.editable,			    valueField:this.valueField,			    name:this.name,			    id:this.id,			    hiddenName:this.hiddenName,			    store:this.store,			    width:this.width,			    mode:this.mode		 });         	 } });  //--------------------------FORMUserBasicInfoTopForm=Ext.extend(Ext.form.FormPanel,{	yearCbo:null,//年份cbo	medicalCompanyCbo:null,//医疗服务单位cbo	//构造方法	constructor:function(){		//intialization year combobox 		this.initYearCbo();		//		this.initMedicalCompanyCbo();				UserBasicInfoTopForm.superclass.constructor.call(this,{		     region:'north',//位于北边		     collapsible:true,//是否可以最小		     //collapsedTitle: true,		     height:80,		     title:'人员基本信息查询条件',		     minSize:50,//最小只能拖到50		     maxSize:120,//最大120			 items: [{//a begin		         xtype : "panel",			     layout : "column",			     border : false,	        	 items:[						{					    xtype:"panel",					    layout:'form',					    border:false,					    width:130,					    labelWidth:55,					    items:[this.yearCbo]					    },					    {						    xtype:"panel",						    layout:'form',						    border:false,						    width:200,						    labelWidth:55,						    items:[this.medicalCompanyCbo]						}	        	       ]			 }]		});	},	//---初始化年度的 Cbo you know	initYearCbo:function(){		 this.yearCbo=new MyComboBox({			 fieldLabel:"报销类型",			 value:"",			 name:"dbyear",			 id:"dbyear",			 url:"/himp/user_basic_info!queryYearListAjax.action",			 autoLoad:true,			 flag:0,			 width:70			 });	},	//初始化医疗服务单位cbo orgCode	initMedicalCompanyCbo:function(){		 this.medicalCompanyCbo=new MyComboBox({			 fieldLabel:"报销类型",			 value:"",			 name:"orgCode",			 id:"orgCode",			 url:"/himp/user_basic_info!queryMedicalUnitAjax.action",			 autoLoad:true,			 flag:0,			 width:140			 });		}});
修改之后的效果:

转载地址:http://husdx.baihongyu.com/

你可能感兴趣的文章
hp 服务器通过串口重定向功能的使用
查看>>
国外10大IT网站和博客网站
查看>>
android第十一期 - SmoothSwitchLibrary仿IOS切换Activity动画效果
查看>>
zabbix 批量web url监控
查看>>
MongoDB CookBook读书笔记之导入导出
查看>>
shell如何快速锁定所有账号
查看>>
HTML 5实现的手机摇一摇
查看>>
Linux 文件IO理解
查看>>
Ninject 2.x细说---2.绑定和作用域
查看>>
30个非常时尚的网页联系表单设计优秀示例
查看>>
使用membership(System.Web.Security)来进行角色与权限管理
查看>>
opticom 语音质量验证白皮书
查看>>
3D实时渲染中的BSP树和多边形剔除
查看>>
Frank Klemm's Dither and Noise Shaping Page: Dither and Noise Shaping In MPC/MP+
查看>>
网络抓包的部署和工具Wireshark【图书节选】
查看>>
Redis在Windows+linux平台下的安装配置
查看>>
Maven入门实战笔记-11节[6]
查看>>
Local declaration of 'content' hides instance variable
查看>>
ASP.NET中 HTML标签总结及使用
查看>>
Linux下日志系统的设计
查看>>