(编辑器)Jquery-EasyUI集合Kindeditor编辑器
1.在html里面添加
list.html
list.html (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,
items: [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link'],
afterChange: function () {
this.sync();
},
afterBlur: function () { this.sync(); }
};
$.parser.plugins.push("kindeditor");
})(jQuery, KindEditor);
2.需要同时引用easyui和kindeditor相关样式和脚本,然后就可以像使用easyui组件一样使用kindeditor:
<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>
调用方法:
<textarea name="easyui_ditor" id="easyui_ditor" class="easyui-kindeditor" style="width: 90%; height: 140px; visibility: hidden;">KindEditor</textarea>
3.360浏览器不兼容,firefox浏览器正常,所以赋值方法
KE.html(id, val)
设置编辑器的HTML内容。
参数:
id:String,编辑器的ID
val: String,HTML字符串
返回值:无
页面只有一个编辑器的话最新版本这样写就可以。
KindEditor.html('#txtIntroduce', data.Introduce);
loadFilter: function (data) {
$.post("../Action/newsList.ashx", { content: $('#easyui_ditor').val() }, function (data) { var json = eval("(" + data + ")");
//alert(json.news[0].Content)
//$('#easyui_ditor').val(json.news[0].Content);
KindEditor.html($('#easyui_ditor'), json.news[0].Content);
//console.info($('#easyui_ditor').val());
});
(编辑器)Jquery-EasyUI集合Kindeditor编辑器的更多相关文章
- 关于JqueryEasyUI集合Kindeditor
写在前面 上一篇<初试JqueryEasyUI(附Demo)>: 在上一篇说过,下面要试下easyui集合编辑器,关于编辑器网上有很多,ckeditor.ueditor.kindedito ...
- 雷林鹏分享:jQuery EasyUI 数据网格 - 扩展编辑器
jQuery EasyUI 数据网格 - 扩展编辑器 一些常见的编辑器(editor)添加到数据网格(datagrid),以便用户编辑数据. 所有的编辑器(editor)都定义在 $.fn.datag ...
- KindEditor 编辑器使用方法
http://kindeditor.net/docs/usage.html 编辑器使用方法 1. 下载编辑器 下载 KindEditor 最新版本,下载之后打开 examples/index.html ...
- KindEditor编辑器在ASP.NET中的使用
KindEditor编辑器在ASP.NET中的使用 最近做的项目中都有用到富文本编辑器,一直在寻找最后用的富文本编辑器,之前用过CKEditor,也用过UEditor,这次打算用 一下KindEdit ...
- 【HTML】KindEditor编辑器在ASP.NET中使用
本文大多内容来自KindEditor官网,自己加工理解后做的一个备份. 编辑器使用方法 1. 下载编辑器 下载 KindEditor 最新版本,下载之后打开 examples/index.html 就 ...
- ThinPHP第二十八天(F函数和file_put_contents区别|PHP生成PHP文件,Kindeditor编辑器使用方法)
1.F(name,data,path)函数和file_put_contents(file,str)区别 F函数直接生成<?php ?>格式的php文件了,将data加入到<?php和 ...
- 将dedecms织梦后台编辑器ckeditor更换为kindeditor,并高亮显示代码
1.下载kindeditor,并解压到kindeditor目录,把kindeditor目录复制到dede的include目录下(ps:修改kindeditor-all-min.js.lang文件夹下z ...
- Django项目开发,XSS攻击,图片防盗链,图片验证码,kindeditor编辑器
目录 一.Django项目开发 1. 项目开发流程 2. auth模块的补充 (1)django的admin可视化管理页面 (2)将admin可视化管理页面的模型表显示成中文 (3)auth模块的用户 ...
- 如何在一个页面添加多个不同的kindeditor编辑器
kindeditor官方下载地址:http://kindeditor.net/down.php (入门必看)kindeditor官方文档:http://kindeditor.net/doc.ph ...
随机推荐
- 微软“One Windows”的梦想已经破灭了吗?
导读 Windows 10 正式公布的时候,微软曾表示该系统将开启更为个性化的计算新纪元,可让用户在使用各类设备处理各项事务时,享受到一致.熟悉和可兼容的体验,从 Xbox 到 PC 和手机,再到平板 ...
- xcode快捷方式 一 快速找到对应文件
事情是这样的,当一个项目进行到一定程度的时候,文件就多了.通过storyboard或xib,相对应的文件.m/.h拖线或其他的操作时,找到对应的文件稍显麻烦.今天,一个快捷方式解决了这个困扰. 注:在 ...
- 网易CC研发工程师 笔试题2016-04-15
题目: 1.判断一个数是否是3的幂. 2.判断一个数是否是3的幂,不用循环或递归. 3.正则表达式用来匹配电话号码. 例:(020) 12345678 020-12345678 还有一题正则 ...
- Tomcat无法启动问题
检查环境变量设置 再打开一个cmd, 1.输入if not exist "%JRE_HOME%\bin\java.exe" echo no jre java 回车 结果:no ...
- 51Nod 1766 树上的最远点对
Description 一棵树,询问两个端点编号分别在在 \([a,b]\) 和 \([c,d]\) 两个区间中的最长链. Sol 线段树+ST表. 树上最长链可以合并,只需要合并两个区间最长链的两个 ...
- 31 GroupSock(AddressString)——live555源码阅读(四)网络
31 GroupSock(AddressString)——live555源码阅读(四)网络 31 GroupSock(AddressString)——live555源码阅读(四)网络 简介 Addre ...
- ubuntu系统安装PHP扩展
GD库的安装 sudo apt-get install php5-gd sudo apt-get install php5-gd sudo /etc/init.d/apache2 restart CU ...
- 3.3---集合栈(CC150)
思路:注意一下别写错add还是remove public class SetOfStacks { public static ArrayList<ArrayList<Integer> ...
- linux 终端全局代理设置
http://www.webupd8.org/2010/10/how-to-set-proxy-for-terminal-quick.html 即 export http_proxy='http:// ...
- Linux查看硬盘型号
Linux查看硬盘型号 -- :: 分类: 服务器与存储 请先确定服务器是否有配 RAID. 如果有RAID,请通过对应的RAID管理(监控)工具查看,例如LSI的MegaCli: # /opt/Me ...