您的位置:首页 > 产品设计 > UI/UE

Kendo UI:Grid中单元格日期格式化

2014-11-27 15:00 232 查看
Grid中怎么格式化时间类型数据?

解决方案
(1)使用format格式化
            {
field: "updateTime",
title: "更新时间",
width: 200,
format: "{0: yyyy-MM-dd HH:mm:ss}"
}


(2)使用template实现
           {
field: "updateTime",
title: "更新时间",
width: 200,
template : kendo.template($("#updatetime_template").html())
}

<script type="text/x-kendo-template" id="updatetime_template">
#= kendo.toString(updateTime, "yyyy-MM-dd HH:mm:ss") #
</script>

note:其实不止以上两种解决方案,具体可查看kendoapi文档,standardnumber
format, custom number format, standard date format or a customdate format.
包含格式化number(美元符号,百分号,float类型等)和date。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: