Kendo UI for Angular中的网格日期格式 [英] Grid Date formating in Kendo UI for Angular

查看:95
本文介绍了Kendo UI for Angular中的网格日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Kendo UI的Angular Grid中格式化日期时间字段,并使过滤器和编辑功能正常工作.我可以使用ng-template并将日期转换成我想要的格式,但是该列的过滤和编辑不起作用.数据来自webapi服务,日期来自json数据,为2017-9-12T00:00:00

I am trying to format a datetime field in the Kendo UI for Angular Grid and have the filter and editing features work. I can use ng-template and pipe the date into the format I want but the filter and editing of the column does not work. The data is coming from a webapi service and the date is coming in the json data as 2017-9-12T00:00:00

推荐答案

需要映射数据,以便在将数据绑定到Grid之前将日期解析为实际的JavaScript Date对象,以便可以通过Grid进一步格式化它们列格式"属性 .为了使编辑和过滤按预期工作,您需要在过滤器" .

Data needs to be mapped such that dates are parsed to actual JavaScript Date objects before data is bound to the Grid, so that they can be further formatted via the Grid column "format" property. For editing and filtering to work as expected, you need to specify the data type in the "filter" and "editor" properties.

这篇关于Kendo UI for Angular中的网格日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆