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
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
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.
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.
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