http://odata.github.io/WebApi/#04-26-InOperator
OData v4 now supports the IN operator as a short hand for multiple or queries (as of http://docs.oasis-open.org/odata/new-in-odata/v4.01/cn01/new-in-odata-v4.01-cn01.html#_Toc485385090 ). This could help to change code such as:
var selectedStations = $("#cmbStations").data("kendoMultiSelect").dataItems();
var stationIds = [];
for (var i = 0; i < selectedStations.length; i++) {
stationIds.push({
field: "StationId",
operator: "eq",
value: stationId
});
}
dataSource.filter({
logic: "or",
filters: stationIds
});
into a much cleaner:
var selectedStations = $("#cmbStations").data("kendoMultiSelect").dataItems();
var stationIds = [];
for (var i = 0; i < selectedStations.length; i++) {
stationIds.push(selectedStations[i].StationId);
}
dataSource.filter({
field: "StationId",
operator: "in",
value: stationId
});
Hi,
The in operator is specific to OData-v4 and integrating it is doable but since it will lack integration in the UI it would be better to handle things manually. For that purpose one can execute the code which is demonstrated for pushing the 'in' filter and inside the parameterMap function modify the parameters and adjust the filtering.
Regards,
Angel Petrov
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.