This is a migrated thread and some comments may be shown as answers.

Filter Angular ComboBox with 'OR'

1 Answer 100 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Christy
Top achievements
Rank 1
Christy asked on 25 Jul 2016, 09:11 PM

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!

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 27 Jul 2016, 03:37 PM
Hello Christy,

The Kendo UI ComboBox does not support filtering with the operator "OR".

This was requested in the past, but so far we have no plans to implement it. Please check more information on why the filter operator "OR" is not supported in the ComboBox widget: 

https://github.com/telerik/kendo-ui-core/issues/466

Let me know if you need additional information on this matter.

Regards,
Stefan
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
ComboBox
Asked by
Christy
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or