I am trying to filter an Angular ComboBox with a dynamic set of filters. However, when I add more than one filter, the combobox is empty. I have tried setting this up on one of your examples, and still cannot get this to work. Here is the code I wrote:
<
div
id
=
"example"
ng-app
=
"KendoDemos"
>
<
div
class
=
"demo-section k-content"
ng-controller
=
"MyCtrl"
>
<
div
style
=
"padding-top: 1em;"
>
<
h4
>Remote data</
h4
>
<
select
kendo-combo-box
k-placeholder
=
"'Select product'"
k-data-text-field
=
"'ProductName'"
k-data-value-field
=
"'ProductID'"
k-filter
=
"'contains'"
k-auto-bind
=
"false"
k-min-length
=
"3"
k-data-source
=
"productsDataSource"
style
=
"width: 100%"
>
</
select
>
</
div
>
</
div
>
</
div
>
<
script
>
var filters = [];
filters.push({ field: "CategoryID", operator: "eq", value: 4 });
filters.push({ field: "ProductID", operator: "eq", value: 1 });
angular.module("KendoDemos", [ "kendo.directives" ])
.controller("MyCtrl", function($scope){
$scope.productsDataSource = {
type: "odata",
serverFiltering: false,
filter: { logic: "or", filters: filters},
transport: {
read: {
url: "//demos.telerik.com/kendo-ui/service/Northwind.svc/Products",
}
}
};
console.log($scope.productsDataSource.filter);
})
</
script
>
If I remove either of the filters, the ComboBox displays exactly as expected. What am I doing wrong?
Thanks!