//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. iOS 相似QQ空间表视图下拉头部视图放大效果实现

    UITableView 是 UIScrollView 的子类. 所以 UIScrollView 的代理方法.在UITableView 上相同可以得到适用. 既然如此那么我们就行知道.在表格下拉的过程中 ...

  2. WPF Prefix 'attach' does not map to a namespace.

    这个是用附加属性时,一定要在属性前面加Path= Visibility="{Binding Path=PlacementTarget.(attach:CommonAttachedProper ...

  3. How to remove focus without setting focus to another control?

    How to remove focus without setting focus to another control? Ask Question up vote 67 down vote favo ...

  4. 使用dbms_metadata.get_ddl遇到ORA-31603

    建了一个外部表,想看看这个表的信息,一查就报错了: SQL> select dbms_metadata.get_ddl('TABLE','ext_case1') from dual; ERROR ...

  5. 5.文件I/O

    1 C标准函数与系统函数的区别 文件的结构体: 1.1 I/O缓冲区 每一个FILE文件流都有一个缓冲区buffer,默认大小8192Byte. 1.2 效率 文件缓冲区会降低效率.这里提供缓冲区主要 ...

  6. Linux学习日记——源码编译Apache

    [本文为笔者在学习Linux 下的软件安装时,尝试使用源码安装Apache 的过程,事后进行一个小小的总结,发现错误望指正.] 一.典型的源码编译安装软件的过程包括以下3步: 1) 运行 config ...

  7. ZBrush各种拓展功能的简单介绍

    ZBrush的一些拓展功能中,比较突出的有2.5D的绘画功能,这个功能可以让ZBrush®从一个三维的雕塑软件转变成为一个二维的绘画软件.你完全可以使用ZBrush®来绘制自己喜欢的平面插画,还可以是 ...

  8. J2EE概念汇总

    JVM 是Java Virtual Machine(Java虚拟机)的缩写,JVM是一种用于计算设备的规范,它是一个虚构出来的计算机,是通过在实际的计算机上仿真模拟各种计算机功能来实现的.Java虚拟 ...

  9. Eclipse配置SVN的几种方法及使用详情(此文章对Myeclipse同样适用)

    一.在Eclipse里下载Subclipse插件 方法一:从Eclipse Marketplace里面下载 具体操作:打开Eclipse --> Help --> Eclipse Mark ...

  10. background--详解(背景图片根据屏幕的自适应)

    background:有以下几种属性: background-color background-position background-size background-repeat backgroun ...