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

Table contextmenu stops working in IE

6 Answers 11 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Alien Interactive AB
Top achievements
Rank 1
Alien Interactive AB asked on 07 Mar 2018, 02:29 PM

When the editor is initialized everything works as expected. I can see the contextmenu for the table but after an postback the contextmenu stops working with the js-error: Access denied. File: LayoutBuilderEngine.js, row: 28, column: 39

Other contextmenus still works.

Using version: 2017.3.913

if (d.tagName == "TD" || d.tagName == "TH") {
                if (this._selectedCell != d) {
                    this._selectedCellClassName = d.className; // here....
                }
                this._selectedCell = d;
            } else

6 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 07 Mar 2018, 03:18 PM
Hi Martin,

Would it be possible to provide the whole page content and its codebehind along with RadEditor table content so that we can reproduce the problem? You can also try to replicate it in its demos.

Does the problem happen when setting the UseRadContextMenu to true and false?

Regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Alien Interactive AB
Top achievements
Rank 1
answered on 07 Mar 2018, 03:35 PM

Ok, this._selectedCell has the error: Access denied, if I jump over that if-statement the contextmenu shows up. Any idea why this happens or how to fix it?

Sorry, it is a lot of code.. Can I do a postback in the demo? 
Does the problem happen when setting the UseRadContextMenu to true and false? Yes, same problem.

0
Alien Interactive AB
Top achievements
Rank 1
answered on 07 Mar 2018, 03:51 PM

I acctually found a standalone project where I could reproduce the issue:

ADMIN EDIT: removed link because it contained our commercial assemblies. Please do not upload the dev versions of our assemblies online.

0
Alien Interactive AB
Top achievements
Rank 1
answered on 08 Mar 2018, 11:49 AM
Ahh, sorry for that. I think it has to do with the combination of radEditor inside an RadAjaxPanel. Try that! Dont think you need so much more than that to reproduce the issue.
0
Accepted
Rumen
Telerik team
answered on 08 Mar 2018, 02:07 PM
Indeed the issue happens only after an AJAX update and under Internet Explorer only.

I managed to fix it by placing the JS code override above the RadEditor declaration:

<script>   
        Telerik.Web.UI.LayoutBuilderEngine.prototype.set_selectedCell = function(tdElement, bStoreState) {
            //if no selected table - do nothing and return
            if (!this._selectedTable || this._selectedTable.tagName != "TABLE") return;
 
            //if !tdElement set the first cell as selected
            if (!tdElement) tdElement = this._selectedTable.rows[0].cells[0];
 
            if (tdElement.tagName == "TD" || tdElement.tagName == "TH") // check if tdElement is TD object
            {
                if (this._selectedCell) {
                    this._selectedCellClassName = tdElement.className; //set styleName if different cell is selected
                }
                this._selectedCell = tdElement;
            }
            else {
                this._selectedCell = null;
            }
 
            if (this._selectedCell)
 
                //set this._selectedRow, this._selectedRowCells, his._selectedRowIndex
                this.set_selectedRow();
 
            //store state for Undo / Redo
            if (this._selectedCell && (false != bStoreState) && this._currentStateIndex == -1) {
                //Clear _state array if there is only one selection element
                if (this._states.length == 1 && this._states[0]["commandName"] == "selection") this._states = [];
 
                var arArgs = {
                    commandName: "selection",
                    selectedColIndex: this._selectedCell.cellIndex,
                    selectedRowIndex: this._selectedRowIndex,
                    nextSelectedColIndex: this._selectedCell.cellIndex,
                    nextSelectedRowIndex: this._selectedRowIndex
                };
 
                this._storeState(arArgs);
            }
        }
    </script>  
<telerik:RadEditor ID="reStructureText" UseEmbeddedScripts="true" ...

Please test it and let me know how it works.

Regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Alien Interactive AB
Top achievements
Rank 1
answered on 08 Mar 2018, 03:50 PM
I think it works, has to test a bit more tomorrow. Thanks so much!
Tags
Editor
Asked by
Alien Interactive AB
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Alien Interactive AB
Top achievements
Rank 1
Share this question
or