Robert Kaucher Robert Kaucher - 1 year ago 298
AngularJS Question

How to disable AngularJS Kendo UI Editor

I have tried using

and well as just the generic
but neither of these worked. Looking at the documentation it's not even clear to me there is a way to disable the control.

Answer Source

You can do this by creating a custom directive:

   .directive("kNgDisabled", function() {
      return {
        restrict: "A",
        link: function(scope, element, attr) {
          scope.$on("kendoWidgetCreated", function(e, widget) {
            var value = scope.$eval(attr.kNgDisabled);

            $(widget.body).attr("contenteditable", !value);

            scope.$watch(attr.kNgDisabled, function(value) {
              $(widget.body).attr("contenteditable", !value);

Then use it like this:

<textarea kendo-editor k-ng-disabled="disabled"></textarea>

Here is a live demo:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download