在一个页面使用多个 kindeditor编辑器
来源:互联网 发布:百度网盘旧版 mac 编辑:程序博客网 时间:2024/06/08 02:52
最开始在页面上使用一个 kindeditor编辑器,没有遇到什么问题。后面需要使用2个的时候。首先我的代码是这样写的;
<tr><th width="80">简介</th><td><textarea name="introduction" id="introduction" >{pigcms{$news.introduction}</textarea></td></tr>
<tr><th width="80">内容</th><td><textarea name="content" id="content" >{pigcms{$news.content}</textarea></td></tr>
JS代码如下:
KindEditor.ready(function(K){kind_editor = K.create("#content",{width:'402px',height:'320px',resizeType : 1,<if condition="$_GET['frame_show']">readonlyMode : true,</if>allowPreviewEmoticons:false,allowImageUpload : true,filterMode: true,items : ['source', 'fullscreen', '|', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist','insertunorderedlist', '|', 'emoticons', 'image', 'link'],emoticonsPath : './static/emoticons/',uploadJson : "{pigcms{$config.site_url}/index.php?g=Index&c=Upload&a=editor_ajax_upload&upload_dir=system/news"});});KindEditor.ready(function(K){kind_editor = K.create("#introduction",{width:'402px',height:'320px',resizeType : 1,<if condition="$_GET['frame_show']">readonlyMode : true,</if>allowPreviewEmoticons:false,allowImageUpload : true,filterMode: true,items : ['source', 'fullscreen', '|', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist','insertunorderedlist', '|', 'emoticons', 'image', 'link'],emoticonsPath : './static/emoticons/',uploadJson : "{pigcms{$config.site_url}/index.php?g=Index&c=Upload&a=editor_ajax_upload&upload_dir=system/news"});});这样写是有问题的,简介和内容只有其中一个可以进行添加和修改操作。。。。。。
后来我又改了下JS代码:如下
var options = { filterMode : true, allowImageUpload : true, items : ['source', 'fullscreen', '|', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist','insertunorderedlist', '|', 'emoticons', 'image', 'link'],width : '600px', height: '250px',emoticonsPath : './static/emoticons/',uploadJson : "{pigcms{$config.site_url}/index.php?g=Index&c=Upload&a=editor_ajax_upload&upload_dir=system/news"}; var editor = new Array(); KindEditor.ready(function(K) { editor[0] = K.create("#content",options); editor[1] = K.create("#introduction",options); });这样简介和内容就都能顺利的进行添加和修改了。。
如果想使用更多的kindeditor编辑器,只需要在那个数组里多添加一个元素就可以了。。
另外,编辑器上面的显示工具是可以自己修改的,只需要修改items里面的内容就行。。。。。。。。
kindeditor官方文档:http://kindeditor.net/doc.php
Kindeditor编辑器初始化参数文档:http://kindeditor.net/docs/option.html
阅读全文
0 0
- 在一个页面使用多个 kindeditor编辑器
- kindeditor 一个页面多个编辑器
- 如何在一个页面上添加多个KindEditor富文本编辑器
- 在页面中添加一个富文本编辑器kindeditor
- 如何在一个页面上使用多个KindeEditor编辑器并将值传递到服务器端
- 编辑器kindeditor 在Asp.net中的使用
- 动态创建多个KindEditor编辑器
- kindEditor编辑器的使用
- KindEditor编辑器的使用
- kindeditor文本编辑器使用
- 使用kindeditor文本编辑器
- kindEditor编辑器的使用
- KindEditor编辑器使用
- KindEditor编辑器的使用
- KindEditor 编辑器使用
- thinkphp使用编辑器kindeditor
- KindEditor编辑器的使用
- KindEditor编辑器使用
- 内存恶鬼drawRect
- Ueditor上传图片,ssh和ssm框架下Ueditor整合
- 【STM32F103攻城笔记】输入捕捉实战
- 【剑指offer-解题系列(43)】和为S的两个数
- android studio倒入一个自己常用的库工程
- 在一个页面使用多个 kindeditor编辑器
- LeetCode 59. Spiral Matrix II
- vue项目生产模式构建
- Redis——基础1
- 局外人的激情
- STM32F1x系列——12864
- 像input,button等元素对齐方法
- block的使用
- linux权限随笔