Currently, the grid is defined as this:
$('#gridManagers').kendoGrid({
dataSource: dataSourceManagers,
columns: [
{ field: 'First', title: 'FirstName' },
{
field: 'HireDate', format: "{0:dd-MM-yyyy}", filterable: {
ui: filterDate
}
},
],
filterable: true,
sortable: {
mode: 'multiple'
},
pageable: true
});
function filterDate(element) {
element.kendoDatePicker({
format: 'MM-dd-yyyy',
close: function (e) {
console.log("_value:"+this._value);
this._value = kendo.toString(this.value(), "MM-dd-yyyy");
console.log("this.value():" + this.value());
}
});
When I select a date from the DatePicker, the console logging shows this:
LOG: _value:Sat Nov 30 00:00:00 UTC+0100 2013
LOG: _current:11-14-2013
LOG: this.value():11-30-2013
The reason I do the conversion from 'Sat Nov 30 00:00:00 UTC+0100 2013' to '11-30-2013' is because the format is not recognized correctly on the server.
What I don't understand how the value from the DatePicker is retrieved by the grid and used to define the filter ?