//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. nyoj-647-奋斗小蜗牛在请客(进制转换)

    奋斗小蜗牛在请客 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描写叙述 一路艰辛一路收获.成功爬过金字塔的小蜗牛别提多高兴了.这不为了向以前帮助他的哥们们表达谢意,蜗牛宴请 ...

  2. 一步一步跟我学习hadoop(5)----hadoop Map/Reduce教程(2)

    Map/Reduce用户界面 本节为用户採用框架要面对的各个环节提供了具体的描写叙述,旨在与帮助用户对实现.配置和调优进行具体的设置.然而,开发时候还是要相应着API进行相关操作. 首先我们须要了解M ...

  3. mysqli数据库操作简单实例

    mysqli数据库操作简单实例 代码 结果

  4. [POJ 2279] Mr. Young's Picture Permutations

    [题目链接] http://poj.org/problem?id=2279 [算法] 杨氏矩阵与勾长公式 [代码] #include <algorithm> #include <bi ...

  5. [MySQL] 按年度、季度、月度、周、日统计查询

    该死的mysql没有提供unix时间戳的专门处理函数,所以,如果遇到时间分组,而你用的又是整型unix时间戳,则只有转化为mysql的其他日期类型!   FROM_UNIXTIM()将unix时间戳转 ...

  6. SSH不允许进行DNS解析

    ssh设置DNS不解析 sed -i "s/#UseDNS yes/UseDNS no/"  /etc/ssh/sshd_config/etc/init.d/sshd restar ...

  7. 【刷题笔记】LeetCode 222. Count Complete Tree Nodes

    题意 给一棵 complete binary tree,数数看一共有多少个结点.做题链接 直观做法:递归 var countNodes = function(root) { if(root===nul ...

  8. CLR寄宿和应用程序域

    Win实际上将CLR作为一个COM服务器实现在一个DLL内,即为CLR定义了标准的COM接口,并为该接口和COM服务器分配一GUID,安装FrameWork时表示CLR的COM服务器被注册到注册表内. ...

  9. 今天,你Try-Catch了吗?

    引言: 高级语言中的异常处理很好用,对于有可能出错的代码我们用Try-Catch包起来,就能保证系统健壮的运行了,但是你的Try-Catch用对了吗? 今天code review的时候,老板给我提了个 ...

  10. C++ should define all local variable outside the loop?

    see the following two examples, the conclusion is that we should define variable in the loop if it c ...