我必须根据可编辑或只读的数据库列表形成重复的剑道编辑器。我能够实现重复的编辑器,但无法使其基于某些数据库字段只读。这个只读必须在页面加载事件中完成。
我正在使用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
。
在第一种情况(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