EXT4 domain对象包含多个其他对象显示
Ext.define("FacilitatorBaseData", 
			{extend:"Ext.data.Model",
		 	fields:[
		 		 {name:"facilitatorName"},
		 		 {name:"evaluationComments"}, 
				 {name:"scopeBusiness"}, 
				 {name:"updateDate", type:"date", dateFormat:"Y-m-dTH:i:s"}
		 	]
		 });
		 
		Ext.define("GarrisonDetail", {
			extend:"Ext.data.Model", 
			fields:[
				{name:"socialInsuranceArea"}, 
				{name:"department"}, 
				{name:"facilitatorBaseData"}
			]
		});
		var store_socialInsuranceArea = Ext.create('Ext.data.ArrayStore', {
			data : [['0','AAA'],['1','BBB'],['2','CCC']],
			fields : [{name: 'id'},{name: 'value'}]
		});  
		
		var store_facilitatorBaseDatas = Ext.create('Ext.data.Store', {
			model : "FacilitatorBaseData",
			displayField : 'id',
			proxy : Ext.create('Ext.data.proxy.Ajax', {
				actionMethods : "POST",
				url : "../fmsbase/findByFacilitatorBaseData.action",
				reader : Ext.create('Ext.data.reader.Json', {
					root : "facilitatorBaseDatas"
				})
			})
		});
		
		var queryView = Ext.create('Ext.form.Panel', {
			region : "north",
			bodyStyle : {padding:'3px'},
			frame : true,
			layout : "border",
			fieldDefaults : {labelAlign:'right'},
			items : [
				Ext.create('Ext.form.FieldSet', {
				region : "center",
				title : "查询条件",
				items : [
					Ext.create('Ext.container.Container', {
						layout : {type:'table', columns: '3'},
						items : [{
							xtype:'combobox',
							store : store_socialInsuranceArea,
							displayField : "value",
							name : "asdasd",
							valueField : "id",
							fieldLabel : "AAAAAAAAA"
						},{
							xtype:'combobox',
							listeners : {'beforequery':loadFacilitatorBaseDatas},
							store : store_facilitatorBaseDatas,
							displayField : "facilitatorName",
							name : "facilitdsdsdatorId",
							valueField : "id",
							fieldLabel : "诗圣杜甫"
						}]
					})
				]})
			]
		})
				
		/**
		{
			xtype:'gridcolumn',
			text : "提交状态",
			store : store_status,
			displayField : 'value',
			valueField : 'id',
			dataIndex : "status",
			renderer : comboboxRenderer
		}
		
		*/
		
		function comboboxRenderer(v, m, rec, row, col) {
			if (v != null) {
				var column = this.columns[col];
				var valueField = column['valueField'];
				var displayField = column['displayField'];
				var store = eval(column['store']);
				var index = store.find(valueField, v);
				if (index != -1) {
					v = store.getAt(index).get(displayField);
				}
			}
			return v;
		}




阅读更多
个人分类: ext
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

EXT4 domain对象包含多个其他对象显示

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭