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. JDK1.8 HashMap 扩容 对链表(长度小于默认的8)处理时重新定位的过程

    关于HashMap的扩容过程,请参考源码或百度. 我想记录的是1.8 HashMap扩容是对链表中节点的Hash计算分析. 对术语先明确一下: hash计算指的确定节点在table[index]中的链 ...

  2. 如何获得scala的帮助和退出

    scala> :helpAll commands can be abbreviated, e.g., :he instead of :help.:edit <id>|<line ...

  3. 搭建asp渗透测试环境

    win2k3下载地址 http://yun.baidu.com/share/link?shareid=77306757&uk=2852438886 win2003 Enterprise Edi ...

  4. WINDOWS防火墙开启后Ping不通

    WINDOWS系统由于安全考虑,当开启防火墙时,默认不允许外主机对其进行ping功能,即别的电脑ping不通本机.别的主机ping不通本机是因为本机的防火墙关闭了ICMP回显功能,只要把这回显功能打开 ...

  5. Jboss 数据源密码明文加密

    转载:https://blog.csdn.net/iberr/article/details/40896479 备注:解密小程序没有测试,知识了解了加密解密过程.对自己的帮助是看懂了连接数据库的配置, ...

  6. as3.0用了视频组件,导致视频打开后就全屏,加一下代码就行

    myFlv.fullScreenTakeOver = false; fullScreenTakeOver : Boolean 舞台进入全屏模式时,FLVPlayback 组件位于所有内容的顶部并占据整 ...

  7. 数值的整数次方(python)

    题目描述 给定一个double类型的浮点数base和int类型的整数exponent.求base的exponent次方. # -*- coding:utf-8 -*- class Solution: ...

  8. HDU-1087.SuperJUmpingJUmpingJumping.(DP and LISPP)

    本题大意:给定一个长度为n的序列a,让你输出这个序列子序列中元素和最大的最大上升子序列. 本题思路:一开始肯定可以想到用LIS实现,我们用LIS实现的时候可以发现这个问题并不满足LIS问题的最优子结构 ...

  9. vue 路由参数变化,页面不更新的问题

    监控$route 在vue项目中,假使我们在同一个路由下,只是改变路由后面的参数值,如果不监听路由参数值的变化,页面无数据刷新,需手动刷新浏览器,这样做就不是我们的预期效果. 举例:当前路由为  /p ...

  10. android的四种线程池

    使用线程池的好处: 首先通过线程池中线程的重用,减少创建和销毁线程的性能开销.其次,能控制线程池中的并发数,否则会因为大量的线程争夺CPU资源造成阻塞.最后,线程池能够对线程进行管理,比如使用Sche ...