Javascript 在Chrome中填充YUI 2.9.0富文本编辑器,然后删除editorHTML

Javascript 在Chrome中填充YUI 2.9.0富文本编辑器,然后删除editorHTML,javascript,google-chrome,yui,rich-text-editor,Javascript,Google Chrome,Yui,Rich Text Editor,当双击行或单击“编辑”按钮并选择行时,我通过数据行中的数据填充YUI RTEIE和FF按预期执行,但Chrome会填充html内容(我从Chrome的inspect el功能中的调试中知道这一点),然后几毫秒后,它会将其删除。有什么建议吗 下面是我如何构建YUI RTE的 function CreateRTE() { //create the RTE: emailEditor = new YAHOO.widget.Editor('txtEmlBody', { width: '4

当双击行或单击“编辑”按钮并选择行时,我通过数据行中的数据填充YUI RTEIE和FF按预期执行,但Chrome会填充html内容(我从Chrome的inspect el功能中的调试中知道这一点),然后几毫秒后,它会将其删除。有什么建议吗

下面是我如何构建YUI RTE的

function CreateRTE() {

    //create the RTE:
    emailEditor = new YAHOO.widget.Editor('txtEmlBody', { width: '468px', height: '200px' });

    //After the Editor renders it, we will hide it so the iframe doesn't bleed through
    emailEditor.on('afterRender', emailEditor.hide);

    //Add the insert token button when the toolbar is loaded
    emailEditor.on('toolbarLoaded', function () {

        //Create the button configuration
        var config = { type: 'menu', label: 'Insert Token', value: 'inserttoken', menu: tokenMenu };

        //Add the button to the toolbar
        emailEditor.toolbar.addButtonToGroup(config, 'insertitem');

        //Add the event handler for a menu item click
        emailEditor.toolbar.on('inserttokenClick', function (ev) { this.execCommand('inserthtml', ev.button.value); }, emailEditor, true);

    });

    //render the editor explicitly into a container within the Dialog's DOM:
    emailEditor.render();


}
下面是我在双击一行或选中一行时单击“编辑”按钮时填充RTE的方式

function EditEmail() {

    //Get the record from the datatable
    var dt = grids.tblEmails.dataTable;
    var tr = dt.getSelectedRows()[0];
    var row = dt.getRecord(tr);

    //Populate the form
    YAHOO.util.Dom.get('hidEmlId').value = row.getData('ID');
    YAHOO.util.Dom.get('hidEmlType').value = row.getData('Type');
    YAHOO.util.Dom.get('txtEmlSubject').value = row.getData('Title');

    emailEditor.setEditorHTML(row.getData('Body'));

    //Show the dialog
    dialogs.dlgEmail.show();

}

我确实读过这篇文章,但这篇文章似乎并不匹配。正在填充html编辑器的上下文,然后将其删除。。。。因此,非常感谢您的帮助。

在设置编辑器的html
(emailEditor.setEditorHTML(row.getData('Body'));)之前,请尝试使用html
(row.getData('Body'))更新编辑器的支持文本区域。
。这应该允许它在Chrome/Safari中工作