Reputation: 33
have two columns in database
I want to format 'CreatedDate' according to the 'DateFormat' column in a kendo grid. I can use template: "#= kendo.toString(kendo.parseDate(CreatedDate), DateFormat) || '' #", but it wont display correct date format in the date time picker of column filter.
so i'm looking something like this //format: "{ 0:#= DateFormat #}",
code sample --------------------------------------------------- columns: [ { field: "CreatedDate", width: "10%", title: "{{ 'CreatedDate' }}", hidden: true, //format: "{ 0:#= DateFormat #}", }
Upvotes: 0
Views: 763
Reputation: 759
You should specify datatype in model. E.g.
dataSource: {
transport: {
read: {
url: "https://demos.telerik.com/kendo-ui/service/tasks",
dataType: "jsonp"
},
},
schema: {
model: {
fields: {
CreatedDate: { type: "date" }
}
}
}
}
Then on columns,
columns:[
...
{ title: "CreatedDate", template:"#=kendo.toString(CreatedDate,DateFormat)#"},
...
]
Upvotes: 0