//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)的更多相关文章

  1. easyUI整合富文本编辑器KindEditor详细教程(附源码)

    原因 在今年4月份的时候写过一篇关于easyui整合UEditor的文章Spring+SpringMVC+MyBatis+easyUI整合优化篇(六)easyUI与富文本编辑器UEditor整合,从那 ...

  2. EasyUI在window中使用kindeditor 4.1.10在IE9中不能回显、获得焦点编辑的问题

    描述 :kindeditor4.1.10版本是当前最新的版本,在浏览器兼容性和功能方面都是值得一赞的,在开发中能方便快捷的满足一些开发需求. 问题 :  问题总是有的.  在使用过程中,遇到EasyU ...

  3. KindEditor 4.1.10 (2013-11-23)首行空格不能显示在编辑器内

    KindEditor版本: KindEditor 4.1.10 (2013-11-23) 一.BUG再现步骤: 1.文章前面插入二个全角空格作为缩进,因为并非所有段落都有缩进故不采用 CSS 的 te ...

  4. 后台文本编辑器KindEditor介绍

    后台文本编辑器KindEditor介绍 我们在自己的个人主页添加文章内容的时候,需要对文章内容进行修饰,此时就需要文本编辑器助阵了! 功能预览 KindEditor文本编辑器 KindEditor文本 ...

  5. 富文本编辑器 KindEditor 的基本使用 文件上传 图片上传

    富文本编辑器 KindEditor 富文本编辑器,Rich Text Editor , 简称 RTE , 它提供类似于 Microsoft Word 的编辑功能. 常用的富文本编辑器: KindEdi ...

  6. 富文本编辑器kindeditor配置

    <!--富文本编辑器kindeditor配置↓ --> <link type="text/css" rel="stylesheet" href ...

  7. ASP.NET MVC+EF框架+EasyUI实现权限管理系列(10)- VSS源代码管理

    原文:ASP.NET MVC+EF框架+EasyUI实现权限管理系列(10)- VSS源代码管理 ASP.NET MVC+EF框架+EasyUI实现权限管系列 (开篇)   (1):框架搭建    ( ...

  8. python 全栈开发,Day83(博客系统子评论,后台管理,富文本编辑器kindeditor,bs4模块)

    一.子评论 必须点击回复,才是子评论!否则是根评论点击回复之后,定位到输入框,同时加入@评论者的用户名 定位输入框 focus focus:获取对象焦点触发事件 先做样式.点击回复之后,定位到输入框, ...

  9. 使用富文本编辑器Kindeditor

    今天在做需求的时候,遇到有一个字段,需要保存带有格式的内容,决定使用富文本框编辑器Kindeditor来实现,解决方法如下: 登录官网下载控件包: http://kindeditor.net/down ...

  10. 将Ecshop后台fckeditor升级更改为kindeditor 4.1.10编辑器

    ecshop在win8部分电脑上,不管用任何浏览器,都打不开,即使升级到最新版本都不行,问题应该吃在fckeditor兼容上.fckeditor 很久未升级,换掉该编辑器是最佳方法 第一步:下载kin ...

随机推荐

  1. 利用js在文本框末尾获得焦点

    function moveEnd(obj) { obj.focus(); var len = obj.value.length; if (document.selection) { var sel = ...

  2. Create a Visual C++ Wizard for Visual Studio 2005

    from:http://www.codeguru.com/cpp/v-s/devstudio_macros/customappwizards/article.php/c12775/Create-a-V ...

  3. 积跬步,聚小流------java信息生成图片

    需求: 是在做证书的时候碰到的这个问题. 当时需求是能够进行在线打印证书,第一次进行的操作是直接打印html,并且已经排好版(用jqprint插件)进行打印.在打印时碰到了兼容的问题,另外因为背景图片 ...

  4. TLS握手

    http://www.ruanyifeng.com/blog/2014/02/ssl_tls.html 1994年,NetScape公司设计了SSL协议(Secure Sockets Layer)的1 ...

  5. 使用VMware搭建3台一模一样的Linux虚拟机

    转自:https://www.linuxidc.com/Linux/2014-08/105909.htm 简介:VMware可以在个人本地一台笔记本机器上同时运行二个或更多Windows.DOS.LI ...

  6. windows下安装ImageMagick扩展

    最近项目中需要用到图片的一些特殊处理——比如:根据用户请求生成任意尺寸的图像.经过一些资料的查找,最终选用了php_imagick.利用 ImageMagick,你可以根据web应用程序的需要动态生成 ...

  7. 通过修改路由,或者增加Route属性来控制访问webApi的路径

    可以通过RouteConfig.cs文件中的路由规则来控制 通过为每个方法增加单独的[Route(“api/xx类/xx方法”)]

  8. Java NIO(一)概述

    说明 java NIO是从java1.4开始引入的一个新的IO API,它支持面向缓冲区,基于通道的IO操作,它的核心是通道(channel),缓冲区(buffer),选择器(selector) NI ...

  9. 使用 Travis-CI 的五个理由

    I use the service of travis-ci now for a year. In that time the continuous integration has often poi ...

  10. SQL学习——基础语句(4)

    前面感觉真的好乱,想哪,写哪.这里慢慢整理…… SQL Having 语句 还是前面的那两个表: grade表: student表: 我们需要查找这里的s_id下的gradeValue的和,这就要分组 ...