easyui编辑器(kindeditor-4.1.10)
//1 重写kindedit -建一个js文件 easyui_kindeditor.js
(function ($, K) {
if (!K)
throw "KindEditor没有定义!";
function create(target) {
var opts = $.data(target, 'kindeditor').options;
var editor = K.create(target, opts);
$.data(target, 'kindeditor').options.editor = editor;
}
$.fn.kindeditor = function (options, param) {
if (typeof options == 'string') {
var method = $.fn.kindeditor.methods[options];
if (method) {
return method(this, param);
}
}
options = options || {};
return this.each(function () {
var state = $.data(this, 'kindeditor');
if (state) {
$.extend(state.options, options);
} else {
state = $.data(this, 'kindeditor', {
options : $.extend({}, $.fn.kindeditor.defaults, $.fn.kindeditor.parseOptions(this), options)
});
}
create(this);
});
};
$.fn.kindeditor.parseOptions = function (target) {
return $.extend({}, $.parser.parseOptions(target, []));
};
$.fn.kindeditor.methods = {
editor : function (jq) {
return $.data(jq[0], 'kindeditor').options.editor;
}
};
$.fn.kindeditor.defaults = {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
uploadJson : '${ctx}/wxMessage/uploadImg.yhtml',
fileManagerJson : '${ctx}/wxMessage/uploadImg.yhtml',
items : [
'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link','fullscreen','wordpaste','source'],
afterChange:function(){
this.sync();//这个是必须的,假设你要覆盖afterChange事件的话,请记得最好把这句加上.
}
};
$.parser.plugins.push("kindeditor");
})(jQuery, KindEditor);
//2 在页面引入 必要的文件 ——kindeditor-4.1.10能够在官方上下载到
<link href="../kindeditor-4.1.10/examples/index.css" rel="stylesheet" />
<script src="../kindeditor-4.1.10/kindeditor.js"></script>
<script src="../kindeditor-4.1.10/kindeditor-all.js"></script>
<script src="../kindeditor-4.1.10/kindeditor-all-min.js"></script>
<script src="../kindeditor-4.1.10/kindeditor-min.js"></script>
<script src="../kindeditor-4.1.10/lang/zh_CN.js"></script>
<script type="text/javascript"
src="<%=request.getContextPath()%>/js/easyui_kindeditor.js"></script>
// 3 页面上用
<input id="content" name="content" class="easyui-kindeditor" style="width: 90%; height: 140px;visibility: hidden;" options="validType:'length[0,500]'" />
//编辑器
<script type="text/javascript">
var editor;
KindEditor.ready(function (K) {
editor = K.create('textarea[name="content"]', {
allowFileManager: true,
resizeType: 1,
allowPreviewEmoticons: false,
items: [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link']
});
});
</script>
// 4 dataGrid 改动时 赋值 编辑框仅仅能手动赋值 row-选中行的数据 content 编辑器id 填充内容row.content KindEditor是我们上面重写kindedit是定义的名字
function editWxSendMessage(row){
$("#win").window('open');
$("#wxsendmessageInfoForm").form('clear');
$("#wxsendmessageInfoForm").form("load", row);
KindEditor.html('#content', row.content);
}
easyui编辑器(kindeditor-4.1.10)的更多相关文章
- easyUI整合富文本编辑器KindEditor详细教程(附源码)
原因 在今年4月份的时候写过一篇关于easyui整合UEditor的文章Spring+SpringMVC+MyBatis+easyUI整合优化篇(六)easyUI与富文本编辑器UEditor整合,从那 ...
- EasyUI在window中使用kindeditor 4.1.10在IE9中不能回显、获得焦点编辑的问题
描述 :kindeditor4.1.10版本是当前最新的版本,在浏览器兼容性和功能方面都是值得一赞的,在开发中能方便快捷的满足一些开发需求. 问题 : 问题总是有的. 在使用过程中,遇到EasyU ...
- KindEditor 4.1.10 (2013-11-23)首行空格不能显示在编辑器内
KindEditor版本: KindEditor 4.1.10 (2013-11-23) 一.BUG再现步骤: 1.文章前面插入二个全角空格作为缩进,因为并非所有段落都有缩进故不采用 CSS 的 te ...
- 后台文本编辑器KindEditor介绍
后台文本编辑器KindEditor介绍 我们在自己的个人主页添加文章内容的时候,需要对文章内容进行修饰,此时就需要文本编辑器助阵了! 功能预览 KindEditor文本编辑器 KindEditor文本 ...
- 富文本编辑器 KindEditor 的基本使用 文件上传 图片上传
富文本编辑器 KindEditor 富文本编辑器,Rich Text Editor , 简称 RTE , 它提供类似于 Microsoft Word 的编辑功能. 常用的富文本编辑器: KindEdi ...
- 富文本编辑器kindeditor配置
<!--富文本编辑器kindeditor配置↓ --> <link type="text/css" rel="stylesheet" href ...
- ASP.NET MVC+EF框架+EasyUI实现权限管理系列(10)- VSS源代码管理
原文:ASP.NET MVC+EF框架+EasyUI实现权限管理系列(10)- VSS源代码管理 ASP.NET MVC+EF框架+EasyUI实现权限管系列 (开篇) (1):框架搭建 ( ...
- python 全栈开发,Day83(博客系统子评论,后台管理,富文本编辑器kindeditor,bs4模块)
一.子评论 必须点击回复,才是子评论!否则是根评论点击回复之后,定位到输入框,同时加入@评论者的用户名 定位输入框 focus focus:获取对象焦点触发事件 先做样式.点击回复之后,定位到输入框, ...
- 使用富文本编辑器Kindeditor
今天在做需求的时候,遇到有一个字段,需要保存带有格式的内容,决定使用富文本框编辑器Kindeditor来实现,解决方法如下: 登录官网下载控件包: http://kindeditor.net/down ...
- 将Ecshop后台fckeditor升级更改为kindeditor 4.1.10编辑器
ecshop在win8部分电脑上,不管用任何浏览器,都打不开,即使升级到最新版本都不行,问题应该吃在fckeditor兼容上.fckeditor 很久未升级,换掉该编辑器是最佳方法 第一步:下载kin ...
随机推荐
- SqlHelper——仅仅由于在人群中多看了你一眼
一.SqlHelper 出场 不是由于大家都在用SqlHelper所以才用,是由于连接数据库关闭数据库查询数据库的多了也就加上了SqlHelper.当你的非常多需求都有一个同样的方法的时候我们没有必要 ...
- C++数值类型极限值的获取
C/C++中基本类型的数值极限值一般来说都是与详细平台有关的,在程序设计的过程中为了写出与平台无关的程序则必须通过合理科学的方法去获取各种类型的极值,经常使用的获取方法有两种:一种是传统的C语言所採用 ...
- 通过Gulp流方式处理流程
http://www.cnblogs.com/gongcheng9990/archive/2014/11/25/4120434.html http://modernweb.com/2014/08/04 ...
- linux中设置TAB键的宽度
对于编程的人员来说,常常须要排版代码,这时候就须要TAB键,但TAB键的宽度太大,非常有可能代码太长,延伸到下一行,这个时候你就须要设置TAB键的宽度了. linux下设置TAB键的宽度,做法例如以下 ...
- UVALive 3027 Corporative Network 带权并查集
Corporative Network A very big corporation is developing its corporative networ ...
- Oracle数据库三种标准的备份方法
Oracle数据库的三种标准的备份方法: 1.导出/导入(EXP/IMP). 2.热备份. 3.冷备份. 注释:导出备件是一种逻辑备份,冷备份和热备份是物理备份. 一.导出/导入(Export/Imp ...
- Google浏览器vim命令
使用鼠标久了,手腕.肩膀依旧疼痛.偶尔逛知乎,看到有人推荐chrome浏览器的vimium插件(火狐浏览器是vimperator),安装了使用了几天,真不愧是浏览器神器,好用到想哭,而且非常容易上手. ...
- ROS-OPENCV
前言:opencv是一个开源的跨平台计算机视觉库. 前提:1.已下载并编译了相关功能包集,如还未下载,可通过git下载:https://github.com/huchunxu/ros_explorin ...
- 利用docker构造并运行一个Redis容器
1.首先我们来编写一个基本的Dockerfile 在任意一个目录下 $ vi Dockerfile 内容填写如下: FROM ubuntu:14.04RUN apt-get updateRUN apt ...
- [转]数据库事务中的隔离级别和锁+spring Transactional注解
数据库事务中的隔离级别和锁 数据库事务在后端开发中占非常重要的地位,如何确保数据读取的正确性.安全性也是我们需要研究的问题.ACID首先总结一下数据库事务正确执行的四个要素(ACID): 原子性(At ...