富文本框回顯


修改的回顯功能
①.單選框的回顯

    需要保存的是被選中的那一個input加上checked屬性

<div class="form-group">
    <label for="isenabled">是否啟用:</label>
    <label class="radio-inline">
        <input type="radio" name="isenabled" id="isenabled" value="true"
            <c:if test="${img.isenabled}">
                checked
            </c:if>
        >是
    </label>
    <label class="radio-inline">
        <input type="radio" name="isenabled" id="isenabled" value="false"
            <c:if test="${!img.isenabled}">
                checked
            </c:if>
         >否
    </label>
</div>

②.富文本框數據的回顯

var E = window.wangEditor
var editor = new E('#intro');
var $text1 = $('#txtIntro');
editor.customConfig.onchange = function(html) {
    // 監控變化,同步更新到 textarea
    $text1.val(html);
}
editor.create();
// 初始化 文本編輯器的內容
editor.txt.html('${img.intro}')
// 初始化對應的內容
$text1.val(editor.txt.html());


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM