1

Suppose I have the following kendo-editor:

<div kendo-editor ng-model="name" k-options="editorOptions"></div>

Then, I have the following editorOptions:

function onChange(e) {
   alert("I am changing.");
}
$scope.editorOptions = { change: onChange };

How can I access the actual kendo-editor object for me to trigger the onChange event without using the normal jQuery selection:

Example: $("#myEditor").kendoEditor().trigger("change")

Amal Dev
  • 1,938
  • 1
  • 14
  • 26
Kim Honoridez
  • 917
  • 2
  • 15
  • 28

1 Answers1

1

You must define control reference in current scope (http://docs.telerik.com/kendo-ui/AngularJS/introduction#getting-widget-references) and you can define events as an attribute:

<div ng-app="app" ng-controller="MyCtrl">
  <div kendo-editor="kendoEditorControl" ng-model="name" k-options="editorOptions" k-on-change="onChange()"></div>
</div>
<script>
  angular.module("app", [ "kendo.directives" ]).controller("MyCtrl", function($scope) {
    $scope.onChange = function() {
     alert($scope.kendoEditorControl.value());
    };
  });
</script>
suvroc
  • 3,058
  • 1
  • 15
  • 29
  • I am not able to resolve this issue. I am experiencing same issue. I have also tried steps at following answer: Kendo UI Editor Events in Angularjs – John Bowyer Mar 16 '16 at 01:22