Completed
Last Updated: 03 Jun 2014 06:01 by ADMIN
ADMIN
Ianko
Created on: 16 May 2014 06:12
Category: Editor
Type: Bug Report
0
The editor breaks when the initial content has invalid content
Due to initial invalid content the Editor's ConvertToXhtml filter throws a JS error that breaks the further initialization of the control. 

A possible resolution is incorporating the following sample code:

<telerik:RadEditor runat="server" ID="RadEditor1" OnClientLoad="OnClientLoad">
</telerik:RadEditor>

<script type="text/javascript">
    Telerik.Web.UI.Editor.NestedElementsFix.prototype._getLastInvalidWrapper = function (node) {
        var parent = node;
        while (parent.parentNode && this._shouldUnwrapNode(parent.parentNode)) {
            parent = parent.parentNode;
        }
        return parent == node ? null : parent;
    }

    function OnClientLoad(editor, args) {
        editor.set_html(editor.get_html(true));
    }
</script>
0 comments