简体   繁体   English

使用ajax我在日期列中绑定剑道网格,它返回剑道网格返回/ Date(1403789061723)/?

[英]using ajax i am binding kendo grid in the date column it returns kendo grid returns /Date(1403789061723)/?

我使用ajax在日期列中绑定kendo网格,它返回kendo网格,返回/ Date(1403789061723)/其他字段正确绑定。在Normal绑定的情况下,其工作正常。是否有任何方法可以修复此错误..... ................................................... ................................................... ................................................... ................................................... ................................................... ................................................... ................................................... ................................................... ................................................... ................................................... ................................................... ........

Ok. 好。 The first thing I would ask is what is the model structure of your data that is being presented back to the grid. 我要问的第一件事是将数据呈现回网格的数据的模型结构是什么。

I suspect that you are using a complex model that is not flattened eg. 我怀疑您正在使用一个不会展平的复杂模型。 You have some custom classes with multiple properties within them. 您有一些具有多个属性的自定义类。

If this is the case the grid and the datasource can not figure out what the actual data type is and treats anything not at the top level of data as a string. 在这种情况下,网格和数据源将无法确定实际数据类型是什么,并将不在数据顶层的任何内容都视为字符串。

To get around this either flatten out the viewmodel data that is being assigned to the grid or use the parsing functions to present the date back. 为了解决这个问题,要么展平分配给网格的视图模型数据,要么使用解析函数来显示日期。 Something like this should work: 这样的事情应该起作用:

columns.Bound(c => c.Date).ClientTemplate("#=kendo.format(\"{0:ddd, dd MMM yyyy}\",kendo.parseDate(Date))#")

Obviously putting what ever date time format you want. 显然把你想要的日期时间格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM