1
votes

I'm using Kendo UI grid. There is one column for 'Time Stamp', the type is DateTime. The data comes from a Json call (asp.net MVC project if matters). Because of this, I have to use a template to show the data in correct format.

{
    field: "TimeStamp", title: "Time Stamp", width: "80px"
    , headerAttributes: {
        style: "white-space: normal"
    }
    , template: '#= showDateTime(data.TimeStamp) #'
},

This way, it shows the datetime correctly in grid. However, when I export it, it export the Json data, i.e.

 /Date(1420524000000)/

Now, I have to convert this datetime data in Json call to string (with good format, so the sort feature in grid will work). I'm thinking that it has to have a better/simple way to show/export the data in correct way.

Any suggestions?

Thanks

1

1 Answers

1
votes

Specify through the dataSource.schema.model.fields that your field is of type date. This way you won't need to parse the data manually, you will have a good template by default, and you will see appropriate filter menu pickers.