简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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