(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 的日期处理方式略有不同,详见:
posted on 2009-05-13 10:59
紫蝶∏飛揚↗ 阅读(5213)
评论(1)