Have a look at this jsfiddle
I have a computed column (NewCol as mentioned in the below code) in the kendo grid - which has filter option enabled. The columns shows True/False based on the data of the other column.
schema: {
model: {
fields: {
OrderID: { type: "number" },
Freight: { type: "number" },
OrderDate: { type: "date" },
ShipCity: { type: "string" },
NewCol: {type: "string"}
}
}
}
The column definition in grid is,
{
field: "NewCol",
title: "Computed",
template: '#= (OrderDate > new Date(1996,6,10) ) ? "False" : "True" #'
}
Now, my issue is, the data are not getting filtered using that column filter i.e. True/False. If I filter with True/False, the grid goes empty.
I have tried defining function in datasource for the column as below, but then its not showing any data for the column.
NewCol: function () {
console.log(this.get('OrderDate'));
if (this.get('OrderDate') > new Date()) return 'False';
else return 'True';
},
Ans shows the js error Uncaught TypeError: undefined is not a function