kendo combo box enable API is not working

624 views Asked by At

I am working on web app using kendo.I need to disable/enable kendo combobox using kendo API but it's not working.

here's my code:

HTML :

<input tabindex="5" id="art" kendo-combo-box ng-model="a.b" k-options='airTypeOptions' class="isRequired displayMode" />

JQUERY :

$("#art").getKendoComboBox().enable(false);
1

There are 1 answers

3
Dion Dirza On

You can get kendo widget reference without jquery, change your html code like this

<input kendo-combo-box="art" tabindex="5" ng-model="a.b" k-options='airTypeOptions' class="isRequired displayMode" />

and this is a sample script to disable it by angular way

<script>
  angular.module("sample", [ "kendo.directives" ])
      .controller("MyCtrl", function($scope){
          $scope.disableComboBox = function() {
             // art already defined as kendo combobox
             $scope.art.enable(false);
          };
      })
</script>

Demo