【问题标题】:Is there any way to make some words (only some words not whole editor) in Rad editor for Ajax read only?有没有办法让 Rad 编辑器中的一些单词(只有一些单词不是整个编辑器)只读?
【发布时间】:2019-01-18 16:35:22
【问题描述】:

我在我的项目中使用 Telerik Rad Editor for Ajax,我想让一些字段/单词只读。我尝试了几件事,它适用于整个编辑器..意味着整个编辑器变成只读的。我只想要一些文字和编辑器的其余部分,因为它是为用户编辑的。是否可以 ?要设置哪个属性?

提前致谢。

【问题讨论】:

  • 这是 ASP.Net 项目。

标签: asp.net ajax readonly radeditor telerik-editor


【解决方案1】:

为了在 RadEditor 中定义可编辑和不可编辑区域,您应该在编辑器内容区域中放置多个 DIV 或 SPAN 元素容器。之后,将 unselectable="on" 属性设置为它们的标签,以禁止选择这些元素。您还应该将 contentEditable 属性设置为“false”以将这些元素置于不可编辑模式。

示例:在 RadEditor 中添加可编辑和不可编辑区域。

<div style="border: red 1px solid;" contenteditable="false" unselectable="on">
    Non Editable AREA
    <div style="border: green 1px solid;" contenteditable="true" unselectable="off">
        <!--Content name="info" -->
        Editable REGION...
        <!--/Content -->
    </div>
    Non Editable AREA
</div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-11
    • 2015-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多