I have an autocomplete textbox working with an odata endpoint. In addition to the $filter that kendo generates I'd like to add an additional filter to eliminate "deactivated" items.
The approach shown in the code below works for grids, but (understandably) kendo uses its own $filter and ignores mine (in particular below, see $filter: "Hidden -eq false" bit):
Is there a spot in the autocomplete or datasource API where I can inject custom filtering? Alternatively I suppose I could create a special ODataController for ProductLines that only shows active items, but it seems "nicer" to just have a single ProductLines OData endpoint and let the clients describe what they want.
The approach shown in the code below works for grids, but (understandably) kendo uses its own $filter and ignores mine (in particular below, see $filter: "Hidden -eq false" bit):
$(
"#product-entry-list input"
).kendoAutoComplete({
filter:
'contains'
,
dataTextField:
'Name'
,
dataSource: {
type:
'odata'
,
serverFiltering:
true
,
serverPaging:
true
,
pageSize: 20,
transport: {
read: {
url: window.rootUrl +
'odata/ProductLines'
,
dataType:
'json'
,
data: {
$filter:
"Hidden eq false"
}
}
},
schema: {
data: (d) => d.value,
total: (d) => d[
'odata-count'
]
}
}
});
Is there a spot in the autocomplete or datasource API where I can inject custom filtering? Alternatively I suppose I could create a special ODataController for ProductLines that only shows active items, but it seems "nicer" to just have a single ProductLines OData endpoint and let the clients describe what they want.