关闭

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

1029人阅读 评论(0) 收藏 举报
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;
		}




0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:195161次
    • 积分:2293
    • 等级:
    • 排名:第16394名
    • 原创:49篇
    • 转载:2篇
    • 译文:0篇
    • 评论:57条
    文章分类
    最新评论