如何在基于数据库数据的ng-repeat循环中使Kendo-UI Editor只读

How to make Kendo-UI Editor readonly inside a ng-repeat loop based on database data

本文关键字:循环 Kendo-UI 只读 Editor ng-repeat 数据 数据库      更新时间:2023-09-26

我必须根据可编辑或只读的数据库列表形成重复的剑道编辑器。我能够实现重复的编辑器,但无法使其基于某些数据库字段只读。这个只读必须在页面加载事件中完成。

我正在使用angularjs。

 <fieldset data-ng-repeat="source in sourceData">
                 <textarea kendo-editor="editorwidget" ng-model="source.Text" id="{{source.id}}" k-tools='[
                        "bold", "italic", "underline", "createTable",      "addColumnLeft", "addColumnRight",
                        "addRowAbove",
                        "addRowBelow", "deleteRow", "deleteColumn", "justifyLeft",
                        "justifyCenter",
                        "justifyRight",
                        "justifyFull",
                        "insertUnorderedList",
                        "insertOrderedList",
                        "indent",
                        "outdent"
                    ]'></textarea></fieldset>

请帮我一下。

只读模式只能在编辑器小部件已经创建时以编程方式触发。

http://docs.telerik.com/kendo-ui/controls/editors/editor/overview configuration-Apply

从这个角度来看,您可以使用kendoWidgetCreated事件或kendoRendered

http://docs.telerik.com/kendo-ui/AngularJS/global-events

在第一种情况(kendoWidgetCreated)中,您将处理单个Editor实例,而在第二种情况(kendoRendered)中,通过获取所有textarea元素和相应的Editor小部件对象来迭代所有这些实例。

http://docs.telerik.com/kendo-ui/AngularJS/introduction widget-references

http://docs.telerik.com/kendo-ui/intro/widget-basics/events-and-methods get-widget-reference