ExtJs中的复杂表格

 var data=[
			{id:1, name:'小王',email:'[email protected]',sex:'男',bornDate:'1991-4-4'},
			{id:2, name:'小李',email:'[email protected]',  sex:'男',bornDate:'1992-5-6'},
			{id:3, name:'小兰',email:'[email protected]',sex:'女',bornDate:'1993-3-7'}
	];
	var store=new Ext.data.JsonStore(
		{
			data:data,
			fields:["id","name","sex","email",{name:"bornDate",type:"date",dateFormat:"Y-n-j"}]
		}
	);
	var colM=new Ext.grid.ColumnModel([
		{
			header:"姓名",
			dataIndex:"name",
			sortable:true,
			editor:new Ext.form.TextField()
		},
		{
			header:"性别",
			dataIndex:"sex"
			//editor:new Ext.form.ComboBox({transform:"sexList",triggerAction: 'all',lazyRender:true})
		},
		{
			header:"出生日期",
			dataIndex:"bornDate",
			width:120,
			renderer:Ext.util.Format.dateRenderer('Y年m月d日'),
			editor:new Ext.form.DateField({format:'Y年m月d日'})
		},
		{
			header:"电子邮件",
			dataIndex:"email",
			sortable:true,
			editor:new Ext.form.TextField()
		}
	]);
	var grid = new Ext.grid.EditorGridPanel({
			region:'north',
			title:"基站数据面板",
			height:200,
			width:600,
			cm:colM,
			autoHeight:true,
			store:store,
			autoExpandColumn:3,
			clicksToEdit:1
	}); 

你可能感兴趣的:(ExtJs)