(编辑器)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 ...
随机推荐
- 教你搭建SpringSecurity3框架( 更新中、附源码)
源码下载地址:http://pan.baidu.com/s/1qWsgIg0 一.web.xml <?xml version="1.0" encoding="UTF ...
- 编码(Code)
很遗憾,直接搜索Code或者编码是很难得找到这本书的,我也是无意中才接触到本书. 第一次读本书,对各方面的知识都不算很懂,觉得很多地方都写的太多浅显,好像本该就是这样子,一个编码系统说的那么麻烦干嘛, ...
- vmware vcenter orchestrator configuration提示“用户名密码错误或登录失败超过次数被锁定”
首次登录,使用默认用户密码登录vmware/vmware vmware vcenter orchestrator configuration提示"用户名密码错误或登录失败超过次数被锁定&qu ...
- Qt5 任务栏托盘功能实现
23333 有一阵子没写博客了,研究了挺长时间qt,学到任务栏托盘时简直无语,网上找得到的代码大多是废码,Qt5不支持或者本身就有毛病不能实现却被n多人转来转去的,甚是无语. 简单托盘功能以下在Qt5 ...
- SNMP常用数据操作
SNMP常用数据操作 snmp编程中常见的数据类型基本上就是integer32/oct_str(字节数组)/counter64/timeticks/dateAndTime这些.很多其它的比如Truth ...
- 2 DelayInterval延时间隔类——Live555源码阅读(一)基本组件类
这是Live555源码阅读的第一部分,包括了时间类,延时队列类,处理程序描述类,哈希表类这四个大类. 这里是时间相关类的第二个部分. 本文由乌合之众 lym瞎编,欢迎转载 http://www.cnb ...
- ubuntu14.04显卡驱动问题(amd5600k集显7650d)
安装ubuntu的时候,多次莫名其妙地黑屏,起初以为是最新得ubuntu14.04安装包不稳定,所以一直尝试了很多次. 重启-->安装-->黑屏(硬盘仍在转动,屏幕上什么都没有)--> ...
- ThreadPool线程池 小结
ThreadPool类提供一个线程池,该线程池可用于发送工作项.处理异步 I/O.代表其他线程等待以及处理计时器 线程池通过为应用程序提供一个由系统管理的辅助线程池使您可以更为有效地使用线程.一个线程 ...
- kendoUI grid 过滤时出错:TypeError toLowerCase is not a function
错误原因:类型不一致. 有些过滤类型为字符串,有些为整型时.
- struts2 如何实现mvc 的?