CKEditor API makes it possible to render the editor content read-only (and thus impossible for the user to edit). Some editor features that will not cause the user to modify the content will still be available, though. This includes, for example, the view of the content source code or features such as preview and editor interface maximization within the browser window.

The most crucial element of the API is the setReadOnly() method which puts the editor into the read-only state and restores it to the editable state.

When the editor goes from the editable into the read-only state, its readOnly property is being set to true (for read-only mode) or false (for editable mode). The readOnly event is also fired after each change of the readOnly property.

This is what CKEditor looks like when it is in read-only mode.

Read-Only Mode on Startup

CKEditor can be configured to open in the read-only mode on startup by setting the CKEDITOR.config.readOnly configuration option to true. For example:

config.readOnly = true;

The same can be achieved by setting the disabled attribute for the <textarea> element that CKEditor replaces.

Read-Only Mode Demo

See also the working “Read-Only Mode” sample that showcases toggling between the read-only and editable mode.

How to Set Ckeditor ReadOnly Mode的更多相关文章

  1. 七牛云:ckeditor JS SDK 结合 C#实现多图片上传。

    成功了,搞了2天.分享一下经验. 首先是把官方的那个例子下载下来,然后照如下的方式修改. 其中tempValue是一个全局变量. function savetoqiniu() { var upload ...

  2. C#基础知识七之const和readonly关键字

    前言 不知道大家对const和readonly关键字两者的区别了解多少,如果你也不是很清楚的话,那就一起来探讨吧!探讨之前我们先来了解静态常量和动态常量. 静态常量 所谓静态常量就是在编译期间会对变量 ...

  3. const 与 readonly知多少

    原文地址: http://www.cnblogs.com/royenhome/archive/2010/05/22/1741592.html 尽管你写了很多年的C#的代码,但是可能当别人问到你cons ...

  4. 基于CkEditor实现.net在线开发之路(7)列表页面开发动作介绍

    一个列表页面不止是查询,它也包含了很多业务上功能的实现,这些业务功能的实现的逻辑我称之为动作.如触发单击按钮删除数据,更改业务表数据,调用webService,调用WCF接口,弹出新窗体新增.修改.查 ...

  5. IOS 杂笔-15(知识小点 readonly)

    readonly是我们并不陌生的属性. 但是他也有值得我们注意的地. 属性如其名-只读-也就是说我们只能读取-不能进行写操作 当我们尝试进行写操作时会如下 但是这并不意味着我们不可以改变其内部的属性 ...

  6. 1.2 - C#语言习惯 - 用运行时常量readonly而不是编译期常量const

    C#中有两种类型的常量:编译期常量和运行时常量.二者有着截然不同的行为,使用不当将会带来性能上或正确性上的问题. 这两个问题最好都不要发生,不过若难以同时避免的话,那么一个略微慢一些但能保证正确的程序 ...

  7. 表单中Readonly和Disabled的区别

    1.readonly是要锁定这个控件,通过在界面上无法修改他(但是通过javascript可以修改他). 2.disabled和readonly有相同的地方也是可以锁定这个控件用户不能改变他的值,但是 ...

  8. C# readonly 与const

    引自:http://www.cnblogs.com/ryuasuka/p/3342282.html?utm_source=tuicool&utm_medium=referral 现在正在学&l ...

  9. 个人CKeditor的config.js配置

    /** * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. * For lic ...

随机推荐

  1. linux下各权限的细分

    PS:有时候你发现用root权限都不能修改某个文件,大部分原因是曾经用chattr命令锁定该文件了.chattr命令的作用很大,其中一些功能是由Linux内核版本来支持的,不过现在生产绝大部分跑的li ...

  2. 初识Elasticsearch,bulk 操作的遇到的那些事

    bulk api可以在单个请求中一次执行多个文档的 create . index . update 或 delete 操作 批量操作的行为(action)必须是以下几种: 行为 解释 create 当 ...

  3. Implementing a Dispose method

    [Implementing a Dispose method] 1.实现System.IDsiposable.Dispose()方法.不能将此方法设置为virtual,子类不能override此方法. ...

  4. 调试JS代码的神器

    1.火狐浏览器的 “Web开发者” 可以打断点,实时查看当前值 2.谷歌浏览器的“开发者工具” 可以打断点,实时查看当前值

  5. getRequestURI getRequestURL 区别

    参考 https://blog.csdn.net/gavid0124/article/details/45390999/ request.getRequestURL() 返回全路径 request.g ...

  6. CSS:opacity:0,visibility:hidden,display:none的区别

    CSS中opacity=0,visibility=hidden,display=none的时候,三者有什么区别呢?? 参考了stackoverflow的博客,才发现区别如下所示: Here is a ...

  7. centos搭建OPENldap

    LDAP是轻量目录访问协议,英文全称是Lightweight Directory Access Protocol,一般都简称为LDAP.它是基于X.500标准的,但是简单多了并且可以根据需要定制.与X ...

  8. as3.0划线带撤销功能

    package com{ import flash.display.MovieClip; import flash.display.SimpleButton; import flash.events. ...

  9. WebSphere Application Server中manageprofiles的使用

    转自 https://www.cnblogs.com/lgfeng/archive/2013/02/21/2921215.html ---------------------------------- ...

  10. NumPy IO

    NumPy IO Numpy 可以读写磁盘上的文本数据或二进制数据. NumPy 为 ndarray 对象引入了一个简单的文件格式:npy. npy 文件用于存储重建 ndarray 所需的数据.图形 ...