I have successfully customized the filter on a Kendo grid, but I am facing a small issue. When there is a date column in the grid, I want to restrict users from typing anything in the filter input. The expected behavior is that users should always select the date from the datepicker to apply the filter. How can I implement an onkeydown function to the filter?
config.js
getallCycles: {
sortable: true,
scrollable: true,
editable: false,
dataBound: function () {
},
filterable:{
extra: false,
operators: {
string: {
startswith: 'Starts with',
eq: 'Is equal to',
contains: 'Contains'
}
}
},
columns: [
{
field: 'assessmentDueDate',
title: 'Cycle Assessments Due Date',
width: '190px',
filterable: {
ui: function (element) {
'use strict';
element.kendoDatePicker({
format: 'yyyy-MM-dd'
});
element.onkeydown({
return false;
});
},
operators: {
string: {
eq: 'Is equal to'
}
}
}
},
]
}