I have a Grid that I have a filter row on (mode: "row"). All of the filters function correctly except for a column that contains dates. I have the datepicker showing, however when I select a date from the datepicker nothing happens and I get the following javascript error:
Uncaught TypeError: Cannot read property 'flatView' of undefined
Here is my code:
$("#inbox").kendoGrid({
sortable: true,
selectable: "row",
navigateable: true,
height: "99%",
filterable: {
mode: "row"
},
schema: {
model: {
fields: {
MessageID: { type: "string" },
MessageText: { type: "string" },
EventTime: { type: "date" },
Subject: { type: "string" },
CaseID: { type: "string" },
ClaimID: { type: "string" }
}
}
},
columns:
[{
field: "MessageID"
},
{
field: "MessageText"
}, {
field: "EventTime",
format: "{0:M/d/yyyy}",
width: "200px",
filterable: {
cell: {
operator: "contains",
showOperators: false,
template: function(args) {
args.element.kendoDatePicker({
format: "{0:M/d/yyyy}",
parseFormats: "{0:M/d/yyyy}",
valuePrimitive: true,
dataTextField: "EventTime",
dataValueField: "EventTime"
});
}
}
}
}, {
field: "CaseID",
width: "200px",
filterable: {
cell: {
operator: "startswith",
showOperators: false
}
}
}, {
field: "ClaimID",
width: "200px",
filterable: {
cell: {
operator: "startswith",
showOperators: false
}
}
}, {
field: "Subject",
filterable: {
cell: {
operator: "contains"
}
}
}],
change: function () {
var row = this.select();
var id = row[0].cells[0].innerText;
var message = row[0].cells[1].innerHTML;
$("#<%= hdnSelectedMessage.ClientID %>").val(id);
$("#<%= lblMessage.ClientID %>").html(message);
}
});