博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
动态生成的元素绑定KindEditor
阅读量:4587 次
发布时间:2019-06-09

本文共 1992 字,大约阅读时间需要 6 分钟。

/* 初始化富文本编辑框配置项 */    var options = {              filterMode : false,              allowImageUpload : true,              items : [                'source', '|', 'undo', 'redo', '|', 'preview','cut', 'copy', 'paste',                'justifyleft', 'justifycenter', 'justifyright',                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent',                'clearhtml', 'quickformat', 'selectall',  '/',                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',                'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',                'table', 'hr', 'baidumap', 'pagebreak',                'anchor', 'link', 'unlink',            ],            cssPath : '${pageContext.request.contextPath}/kindeditor/plugins/code/prettify.css',            wellFormatMode : true,            /* 指定上传文件的服务器端程序。 */            uploadJson : '${pageContext.request.contextPath}/kindeditor/jsp/upload_json.jsp',            /* 指定上传文件的服务器端程序。 */            fileManagerJson : '${pageContext.request.contextPath}/kindeditor/jsp/file_manager_json.jsp',            allowFileManager : true,            afterCreate : function() {                this.sync();            },            afterBlur: function () {                 this.sync();                }                        };

在动态生成的方法里加入的代码:

var kinditerindex = 0;                    var dctripIndex = 1;                    $("#Container").find("textarea").each(function (index, item) {                                var editor = new Array();                                      KindEditor.ready(function(K) {                                          editor[kinditerindex] = K.create('textarea[name="dctrip'+dctripIndex+'"]',options);                                    });                                     kinditerindex++;                                    dctripIndex++;            });

 

转载于:https://www.cnblogs.com/weizhanyu/p/9974858.html

你可能感兴趣的文章
BZOJ【1606】购买干草
查看>>
MySQL 删除重复数据实例
查看>>
。。。
查看>>
【HDU 4276】The Ghost Blows Light(树形DP,依赖背包)
查看>>
一分钟将你的WPF应用程序变身成炫彩动态Metro风格
查看>>
iOS 学习资料Blog 技术论坛等,不断添加中。。。。
查看>>
简单实现Tabbar的隐藏显示动画 By H罗
查看>>
电脑自动开机设置教程
查看>>
rpc接口mock平台
查看>>
传感器模块
查看>>
《奇思妙想》人物篇--图灵奖得主概览
查看>>
Azure开发者任务之二:Cloud Service项目添加到ASP.Net Web中
查看>>
2017.2.28 activiti实战--第七章--Spring容器集成应用实例(五)普通表单
查看>>
读书笔记第一章
查看>>
Android 操作SQLite基本用法
查看>>
iis7 发布mvc3 遇到的HTTP错误 403.14-Forbidden Web 服务器被配置为不列出此目录的内容...
查看>>
(vue.js)element ui 表单验证 this$refs[formName]validate里面的内容死活不执行
查看>>
启动多个appium服务(同时运行多台设备)
查看>>
Java大数相乘-hdu1063
查看>>
mysql-mmm 部署高可用集群
查看>>