Filter Angular ComboBox with 'OR'

2 posts, 1 answers
  1. Christy
    Christy avatar
    48 posts
    Member since:
    May 2016

    Posted 25 Jul 2016 Link to this post

    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!

  2. Answer
    Stefan
    Admin
    Stefan avatar
    1025 posts

    Posted 27 Jul 2016 Link to this post

    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.
     
Back to Top