CKEditor在附加的textarea [英] CKEditor on appended textarea

查看:130
本文介绍了CKEditor在附加的textarea的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用CKEditor初始化一个新的textarea,我已经阅读了4版本的文档,但我还不明白怎么做...

I need to initialize a new textarea with CKEditor, I have read the documentation for the 4 version, but I haven't understood how to do it...

var form='<form id="editel_form" method="post" action="function.php" enctype="multipart/form-data" target="hidden_upload" onsubmit="javascript:upload_started()" class="formcor"><ul class="formconte">';                               
form+="<li class='cont'>Element Category: <br/><select id='de_cat' name='de_cat'></select>";                                
form+="<li class='cont'>Element New Name:<br/> "+data['id']+"<input type='text' id='de_name' name='de_name' value='"+data['title']+"'/></li>";                          
form+="<li class='cont'>Element Current Image:<br/><img src='"+data['image']+"' /></li>";                           
form+="<li class='cont'>Element New Image:<br/><input id='de_image' name='de_image' type='file' /></li>";
form+="<li class='cont'>Element New Price:<br/> <input type='text' id='de_price' name='de_price' value='"+data['price']+"' /></li>";
form+="<li class='cont'>Element New Position:<br/> <input type='text' id='de_pos' name='de_pos' value='"+data['position']+"' /></li></ul>";
form+="<ul class='textar'><li>Description:<br/><textarea id='de_desc' name='de_desc' class='ckeditor'>"+data['description']+"</textarea></li></ul>";
form+="<img src='css/loader.gif' class='loadingimg' /><input type='submit' id='sub_edit' name='sub_edit' value='Submit Changes' class='sendval' submit='return false;'/></form>";
$('#elementstable').after($('#elementstable')).append(form);$('#d_cat > option').clone().appendTo('#de_cat');
$("#d_cat option:selected").attr('selected','');
$("#d_cat option[value='"+data['category']+"']").attr('selected','selected');
new CKEDITOR.dom.node($('#de_desc'));


推荐答案

基本上调用 CKEDITOR.replace ('de_desc')请参阅文档

这篇关于CKEditor在附加的textarea的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆