Hi,
I am using the Kendo UI grid for the first time and generally so far, so good. I do have one issue though where I cannot get the date picker to show next to a filterable column. I've read the documentation but it doesn't seem to work for some reason - it filters like a string. here is my code:
The JSON:
"date_of_birth":"2015-01-27 12:00:00.0",
The Javascript:
I've attached a screenshot of my HTML output showing no date picker on the filter. Have I missed something?
I am using the Kendo UI grid for the first time and generally so far, so good. I do have one issue though where I cannot get the date picker to show next to a filterable column. I've read the documentation but it doesn't seem to work for some reason - it filters like a string. here is my code:
The JSON:
"date_of_birth":"2015-01-27 12:00:00.0",
The Javascript:
$(document).ready(
function
() {
$.support.cors =
true
;
// For IE8 & 9
$(
"#patientList"
).kendoGrid({
dataSource: {
transport: {
read: {
url:
"http://10.100.23.92:8082/biodose-connect/patients"
,
dataType:
"json"
,
type:
"GET"
}
},
pageSize: 5
},
schema: {
model: {
fields: {
fullname: { type:
"string"
},
date_of_birth: { type:
"date"
},
nhsnumber: { type:
"string"
},
postcode: { type:
"string"
}
}
}
},
reorderable:
true
,
groupable:
true
,
sortable:
true
,
filterable: {
mode:
"row"
},
pageable: {
refresh:
true
,
pageSizes:
true
,
buttonCount: 5,
messages: {
itemsPerPage:
"patients per page"
}
},
columnMenu: {
columns:
true
,
filterable:
false
,
sortable:
true
},
columns: [
{
width: 60,
template:
"<i class='glyphicon glyphicon-user default-userImg'> </i>"
},
{
field:
"title"
,
title:
"Title"
,
width: 100,
filterable:
false
},
{
field:
"fullname"
,
title:
"Patient Name"
,
filterable: {
cell: {
showOperators:
true
,
operator:
"contains"
,
suggestionOperator:
"contains"
}
}
},
{
field:
"date_of_birth"
,
title:
"DOB"
,
format: moment().format(
"Do MMM YYYY"
),
width: 200,
filterable: {
ui:
"datepicker"
,
cell: {
showOperators:
false
,
operator:
"contains"
,
suggestionOperator:
"contains"
}
}
},
{
field:
"nhsnumber"
,
title:
"NHS Number"
,
width: 200,
filterable: {
cell: {
showOperators:
false
}
}
},
{
field:
"postcode"
,
title:
"Postcode"
,
width: 200,
filterable: {
cell: {
showOperators:
false
,
operator:
"contains"
,
suggestionOperator:
"contains"
}
}
}
],
selectable:
"row"
,
change:
function
(e) {
var
grid = $(
"#patientList"
).data(
"kendoGrid"
);
var
selectedRow = grid.dataItem(grid.select());
console.log(selectedRow.patient_id)
}
});
});
I've attached a screenshot of my HTML output showing no date picker on the filter. Have I missed something?