I’m populating the YUI RTE via data from a data row when the row is double clicked or an ‘Edit’ button is clicked and a row is selected. IE and FF perform as expected, but Chrome populates the html content (I know this from debugging in chrome’s inspect el feature), and then milliseconds later, it erases it. Any suggestions??
Here’s how I’m building the 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();
}
and here’s how I’m populating the RTE when a row is double clicked or the edit button is clicked when a row is selected.
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();
}
I did read this article, but the issue doesn’t seem to match. The context of the html editor is being populated, and then removed…. sooo , any help would be very much appreciated.
try updating the editor’s backing text area with the html
( row.getData('Body') ),prior to setting the editor’s html(emailEditor.setEditorHTML(row.getData('Body'));). This should allow it to work in Chrome/Safari.