可编辑表格,
1.编辑前:由于数据库中该字段是date型的,在转化为json时没处理,前台得到的是
"checkDate":{"date":1,"day"
:4,"hours":0,"minutes":0,"month":11,"nanos":0,"seconds":0,"time":1322668800000,"timezoneOffset":-480
,"year":111}
所以用蓝色字处理。
2.编辑后:页面选择时间后,格式化可用红色字处理
{
id: 'checkDate', dataIndex: 'checkDate',header: '审批时间', align: 'left',sortable: true,
editor: new Ext.form.DateField({format:'Y-m-d'}),
renderer: function(v){
if(v.time){
v = new Date(v.time);
}
return Ext.util.Format.date(v, 'Y-m-d');
}
}