Trying to filter a WCF service by date. I can filter via a grid/gui, and I can setup default filters for every other column/field. I just can't seem to get the date to work. The error I get back is........... "value":"Operator 'eq' incompatible with operand types 'Edm.DateTime' and 'Edm.String'
Data format from the WCF is as follows... "EFFECTIVE_DATE":"\/Date(1065657600000)\/",
One perplexing thing is that if I add the following, it filters by the top parameter, and the grid actually looks like it wants to filter by date. If I click on the filter next to "EFFECTIVE DATE" is actually HAS the correct date and operator all filled in. Clicking on "filter" then makes it filter perfectly. So why won't it just filter it to begin with like every other type of field?
More to the example....
One perplexing thing is that if I add the following, it filters by the top parameter, and the grid actually looks like it wants to filter by date. If I click on the filter next to "EFFECTIVE DATE" is actually HAS the correct date and operator all filled in. Clicking on "filter" then makes it filter perfectly. So why won't it just filter it to begin with like every other type of field?
filter: [
{ field:
"SYMBOL"
, operator:
"eq"
, value:
"NLP"
},
{ field:
"EFFECTIVE_DATE"
, operator:
"eq"
, value:
"\/Date(1065657600000)\/"
}
],More to the example....
<script>
$(document).ready(
function
() {
var
grid = $(
"#grid"
).kendoGrid({
dataSource: {
type:
"odata"
,
transport: {
read:
"http://someURL/Data.svc/Policies"
,
// dataType: "json",
},
filter: [{
field:
"SYMBOL"
,
operator:
"eq"
,
value:
"NLP"
}, {
field:
"EFFECTIVE_DATE"
,
operator:
"eq"
,
value:
"\/Date(1065657600000)\/"
}],
schema: {
model: {
fields: {
SYMBOL: {
type:
"string"
},
FIRM_NAME: {
type:
"string"
},
EFFECTIVE_DATE: {
type:
"date"
},
PolicyStatusID: {
type:
"string"
},
}
}
},
pageSize: 20,
serverPaging:
true
,
serverFiltering:
true
,
serverSorting:
true
},
height: 350,
filterable:
true
,
sortable:
true
,
pageable:
true
,
columns: [{
field:
"FIRM_NAME"
,
}, {
format:
"{0:MM/dd/yyyy}"
,
field:
"EFFECTIVE_DATE"
,
title:
"EFFECTIVE_DATE"
,
// template: '#= kendo.toString(EFFECTIVE_DATE, "MM/dd/yyyy") #'
}, {
field:
"PolicyStatusID"
,
}, {
field:
"SYMBOL"
,
}, ]
});
});
</script>