Completed
Last Updated: 06 Oct 2015 14:42 by Chad
ADMIN
Danail Vasilev
Created on: 18 Sep 2014 10:28
Category: Editor
Type: Bug Report
0
FIX Setting background color to a call in a nested table inserts nbsp in parent td under IE
Steps to reproduce the issue:

1) Run the code below in IE11

2) Set background color to the "some text" cell by right clicking and then selecting cell property through the context menu.

3) Switch to design - there are many nbps's added.

ASPX:

<telerik:RadEditor ID="RadEditor1" runat="server">
            <Content>
                <table>
                    <tbody>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>
                            <table>
                                <tbody>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>some text&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                </tbody>
                            </table>
                            &nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                    </tbody>
                </table>
            </Content>
        </telerik:RadEditor>
For the time being you can place the following JavaScript workaround below the editor's declaration:

        <script type="text/javascript">
            if ($telerik.isIE) {
                Telerik.Web.UI.Editor.CommandList.SetCellProperties = function (commandName, editor, commandArgs) {
                    var $ECL = Telerik.Web.UI.Editor.CommandList;
                    var argument = $ECL._getTableArgument(editor, 2, false, true);

                    if (!argument) {
                        alert(editor.getLocalizedString("cellwarning"));
                        return false;
                    }

                    $ECL._getDialogArguments(argument, "TABLE", editor, commandName);

                    var previousTable = $ECL._getParentTable(editor);

                    var callbackFunction = $ECL.getCallbackFunction(commandArgs, function (sender, args) {
                        $telerik.$(args.tableToModify).insertAfter(previousTable);
                        $telerik.$(previousTable).remove();

                        if (args.styleSheetToImport)
                            $telerik.$(args.styleSheetToImport).insertAfter(args.tableToModify);
                        if (args.styleSheetToRemove)
                            $telerik.$(args.styleSheetToRemove).remove();
                    });
                    editor.showDialog("TableWizard", argument, callbackFunction);
                    return false;
                }
            }
        </script>

1 comment
Chad
Posted on: 10 Dec 2014 19:29
Has this been fixed yet?