easyui용 KindEditor 편집기

6267 단어
<link href="~/Scripts/Kindeditor/themes/default/default.css" rel="stylesheet" />
<link href="~/Scripts/uploadify/uploadify.css" rel="stylesheet" />

<div class="fitem">
<div class="details_text" style="width: 700px; height: 500px; float: left;">
<textarea id="editor_id" style="height: 500px; width: 670px" name="content">textarea>
div>
div>

<script type="text/javascript" src="~/Scripts/Kindeditor/kindeditor-all.js">script>
<script type="text/javascript" src="~/Scripts/Kindeditor/zh-CN.js">script>
<script type="text/javascript" src="~/Scripts/uploadify/jquery.uploadify.min.js">script>
var kindeditor;
$(function () {
    // 
    KindEditor.ready(function (K) {
        kindeditor = K.create('#editor_id', {
            //uploadJson: '/Management/UploadPic?type=1&result=' + result + "&imgUrl=" + imgUrl + "&returnType=" + returnType,
            uploadJson: web_dir + '/Management/UploadPic?type=1',//
            allowFileManager: false,//true 。
            pasteType: 1,// ,0: , 1: , 2:HTML 

            //urlType,// 。 : String; :  kindeditor.js 
            afterCreate: function () {//
                var self = this;
                K.ctrl(document, 13, function () {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function () {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
    });

    setTimeout(function () {
        getInfo(curId);
    }, 300)
})

오류의 큰 원인은 편집기가 DOM을 다 렌더링하지 않고 요청 데이터를 보냈기 때문에 타이머를 넣었고, 안 되면 길게 고쳤기 때문이다
// 
kindeditor.html(unescape(msg.row_data.record.SugContent));
// 
var detailHtmlStr = escape(kindeditor.html());

 https://blog.csdn.net/ibenxiaohai123/article/details/77318574

좋은 웹페이지 즐겨찾기