首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angularjs中的Kendo UI编辑器事件

Angularjs中的Kendo UI编辑器事件
EN

Stack Overflow用户
提问于 2015-10-05 13:37:51
回答 1查看 2.4K关注 0票数 2

如何从Kendo编辑器中的事件中获取事件属性?

我从KendoDemo下载中提取了代码,并对其进行了一些编辑,以获得k-on-changek-on-keydown的事件。事件被描述为这里

代码语言:javascript
复制
<div id="example" ng-app="KendoDemos">
    <div ng-controller="MyCtrl">
            <textarea kendo-editor k-ng-model="html" k-on-keydown="keydown(e)" k-on-change="onChange(e)"></textarea>
    </div>
</div>

<script>
  angular.module("KendoDemos", [ "kendo.directives", "ngSanitize" ])
      .controller("MyCtrl", function($scope){
          $scope.html = "<h1>Kendo Editor</h1>\n\n" +
          "<p>Note that 'change' is triggered when the editor loses focus.\n" +
              "<br /> That's when the Angular scope gets updated.</p>";
          $scope.onChange = function(e){
            console.log('onchange');
            console.log(e);
          };
          $scope.keydown = function(e){
            console.log('keydown');
            console.log(e);
          }
      })
</script>

事件方法onChange和keyDown中的输出不给我文档中描述的e属性。

我遗漏了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-10-05 13:46:34

橡胶鸭的调试效果.

找到我要找的东西,使用k-options添加所有选项。

代码语言:javascript
复制
<div id="example" ng-app="KendoDemos">
    <div ng-controller="MyCtrl">
            <textarea kendo-editor k-ng-model="html" k-options="options"></textarea>
    </div>
</div>

<script>
  angular.module("KendoDemos", [ "kendo.directives", "ngSanitize" ])
      .controller("MyCtrl", function($scope){
          $scope.html = "<h1>Kendo Editor</h1>\n\n" +
          "<p>Note that 'change' is triggered when the editor loses focus.\n" +
              "<br /> That's when the Angular scope gets updated.</p>";
          $scope.options = {
              change: function(e){console.log(e);},
              keydown: function(e){console.log(e);}
          };
      })
</script>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32950034

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档