(1)function fd(){value?value.dataFormate("M d,Y")} //里面除英文字母外的字符可自定义.
(2)cm:{header:"日期",dataIndex:"data",renderer:fd} //Grid列的定义.
(3)store:{name:"data",type:"date",dateFormat:"m/d/Y"} //接收JSON数据中日期型格式:02/28/1998.
(4)new Ext.form.dateField({format:"m/d/Y"....}) //组件UI显示样式和提交值:02/28/1998.
(5)var t=new Date("02/28/1998") //字符串转换成日期型,注:如t输入给store,字符串必须匹配,即同为"m/d/Y"格式,1998-02-28报错.
var record=new Ext.data.Record({});
record.set("data",t);
store.insert(0,t);
注:"m/d/y" 可在EXTJS API DATE类中找到.
ListView 与GridPanel 的日期处理方式略有不同,详见:
http://www.blogjava.net/algz/articles/324678.html
posted on 2009-05-13 10:59
紫蝶∏飛揚↗ 阅读(5332)
评论(1) 编辑 收藏