富文本框

1.HTML代码:

<tr id="illegal">
<th></th>
<td colspan="3" style="width:85%">
<textarea id="illegaleditor" name="report.illegal" style="width:98%;height:250px;">
</textarea>
</td>
</tr>

 

2.JS代码

需要引入'${basePath}/s/js/kindeditor/kindeditor.js'

var illegaleditor = "illegaleditor";
setTimeout(function () {
illegalEditor = KindEditor.create('#' + illegaleditor, {
resizeType: 1,
uploadJson: 'kindeditor/upload_json.ashx',
fileManagerJson: 'kindeditor/file_manager_json.ashx',
allowPreviewEmoticons: false,
allowImageUpload: false,
items: [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'link']
});
}, 0);

 

3.修改和详情赋值

success:function(text){
var modData = nui.decode(text);
illegaleditor .html(modData.illegaleditor );

posted @ 2016-03-15 23:11  彬彬无  阅读(899)  评论(0编辑  收藏  举报