This is a migrated thread and some comments may be shown as answers.

Code snippets coming after remove table style from insert table popup

6 Answers 56 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Rajiv
Top achievements
Rank 1
Rajiv asked on 17 Apr 2019, 12:02 PM

 

Hi,

Code snippets coming after remove table style from insert table popup in chrome,ie,ff.

I am facing a big problem in editor please give any solution.

Link: https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

Steps to reproduce

Step 1

Try to insert table from Insert Table from editor toolbar.

Step 2

Right click on cell then click on Table/cell properties. A table wizard popup will come.

Step 3

Click on Table Layouts tab on the table wizard popup.

Step 4

Select any value from table styles drop down.

Step 5

Now you can see  TABLE>TR>TD>RemoveElement on the bottom of the editor.click on RemoveElement .

After click on RemoveElement you can see STYLE>RemoveElement  again click on RemoveElement.

then you can see like below in the editor.

.telerik-reTable-2 { border-collapse: collapse; border: solid 0px; font-family: Tahoma; } .telerik-reTable-2 tr.telerik-reTableHeaderRow-2 { border-width: 1.0pt 1.0pt 3.0pt 1.0pt...........

 

6 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 17 Apr 2019, 12:47 PM
Hi Rajiv,

Thank you for reporting this scenario.

I need a little bit of help, because I am unable to see the following part of the scenario:

After click on RemoveElement you can see STYLE>RemoveElement  again click on RemoveElement.

After executing the 5th step, I get DIV -> RemoveElement or nothing in the module.

Can you please record and attached a video demonstration to see how to replicate the issue? Thank you!

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Rajiv
Top achievements
Rank 1
answered on 17 Apr 2019, 02:41 PM

Thanks Rumen for quick response.

PFA.

 

I was unable to upload .swf file extention that's why i was change it to .jpg format.

just chage it to .swf and see.

If you need any help then please let me know.

 

Thanks

0
Rumen
Telerik team
answered on 17 Apr 2019, 03:14 PM
Hi Rajiv,

Thank you for the video!

The problem was reproduced and logged for fixing in our backlog. Your Telerik points were also updated for the bug report.

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Accepted
Rumen
Telerik team
answered on 17 Apr 2019, 03:32 PM
I am following up with good news and a solution for the reported issue. 

Here we go:

<script>
    var $T = Telerik.Web.UI;
    var utils = $T.Editor.Utils;
    var isTag = utils.isTag;
    var dom = Sys.UI.DomElement;
    var addClass = dom.addCssClass;
    var removeClass = dom.removeCssClass;
    var hasClass = dom.containsCssClass;
    var $EditorModules = $T.Editor.Modules;
 
    $EditorModules.RadEditorDomInspector.prototype.removeSelectedElement = function(elem) {
        var editor = this.get_editor();
        var tag = function (name) { return isTag(elem, name); };
        var cmd;
 
        try {
            if (tag("TD") || tag("TH")) {
                editor.fire("DeleteCell");
            }
            else if (tag("TR")) {
                var cells = elem.getElementsByTagName("td");
                if (cells.length) {
                    this.selectElement(cells[0]);
                    editor.fire("DeleteRow");
                }
            }
            else if (tag("TABLE") || tag("TBODY") || tag("THEAD") || tag("TFOOT") ||
                tag("EMBED") || tag("OBJECT") ||
                tag("INPUT") ||
                tag("IMG") ||
                tag("HR") ||
                tag("STYLE")) {
                cmd = new Telerik.Web.UI.Editor.GenericCommand(this._removeElementString, editor.get_contentWindow(), editor);
                window.setTimeout(function () {
                    elem.parentNode.removeChild(elem);
                    editor.setFocus();
                    editor.executeCommand(cmd);
                    editor.raiseEvent("selectionChange");
                }, 0);
            }
            else if (elem !== editor.get_contentArea()) {
                cmd = new Telerik.Web.UI.Editor.GenericCommand(this._removeElementString, editor.get_contentWindow(), editor);
                Telerik.Web.UI.Editor.Utils.removeNode(elem);
                editor.setFocus();
                editor.executeCommand(cmd);
            }
        }
        catch (ex) { }
 
        editor.raiseEvent("selectionChange");
    }
</script>
<telerik:RadEditor ID="RadEditor1" runat="server"></telerik:RadEditor>

Please let me know how the fix works on your side and is there any issues or side effects after applying it. 

Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Rajiv
Top achievements
Rank 1
answered on 18 Apr 2019, 10:52 AM

Thanks Rumen.

Now its working fine.

 

Thank you so much.

0
Rumen
Telerik team
answered on 18 Apr 2019, 11:20 AM
Perfect! Thank you for testing the solution!

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Editor
Asked by
Rajiv
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Rajiv
Top achievements
Rank 1
Share this question
or