Completed
Last Updated: 27 Oct 2016 13:27 by ADMIN
ADMIN
Marin Bratanov
Created on: 19 Oct 2016 14:37
Category: Editor
Type: Bug Report
1
JavaScript error when dispsing RadEditor with RenderMode=Classic and RadScriptManager with EnableScriptCombine=true
In R3 2016 SP1 when a RadEditor with RenderMode=Classic is disposed and RadScriptManager is used, a JavaScript error is thrown:
IE:  Object doesn't support property or method 'dispose'
Chrome: Uncaught TypeError: this._contextMenuFunctionality.dispose is not a function

FIXED in R3 2016 SP2 (2016.3.1027)

There are three workarounds:
- Set EnableScriptCombine to false for the RadScriptManager (not applicable when CDN is used)
- OR set RenderMode=Lightweight for the RadEditor (you can do this in the web.config for all control instance in the web app if they do not define the Classic mode exiplicitly)
- OR add the following function override at the end of your page:

			<telerik:RadScriptManager ID="RadScriptManager1" runat="server" >
			</telerik:RadScriptManager>

			<%-- WORKAROUND 1: SET EnableScriptCombine="false" TO RADSCRIPTMANAGER--%>

			<asp:Button ID="Button1" Text="click to postback and break the editor" runat="server" />

			<telerik:RadEditor ID="txtInstructions" runat="server">
			</telerik:RadEditor>

			<%-- WORKAROUND 2: SET RenderMode="Lightweight" TO RADEDITOR--%>


			<%--WORKAROUND 3: ADD THE FOLLOWING SCRIPT TO THE END OF THE FORM--%>
			<script>

				Telerik.Web.UI.Editor.DefaultToolAdapter.prototype.dispose = function ()
				{
					delete this._fakeToolbarParentCreated;
					var toolbars = this._getToolBarElements();
					if (toolbars) {
						for (var i = 0; i < toolbars.length; i++) {
							$clearHandlers(toolbars[i]);
						}
					}
					this._tools = [];
					this._disposeToolbarModeHandlers();
					var wnd = this._toolbarHolder;
					if (wnd && wnd.dispose) wnd.dispose();
					var contextMenuFunctionality = this._contextMenuFunctionality;
					if (contextMenuFunctionality && contextMenuFunctionality.dispose) contextMenuFunctionality.dispose();
					Telerik.Web.UI.Editor.DefaultToolAdapter.callBaseMethod(this, "dispose");
				}
			</script>
4 comments
ADMIN
Marin Bratanov
Posted on: 27 Oct 2016 13:27
We just released R3 2016 SP2 (2016.3.1027) - an official service pack with this issue fixed.
dsb
Posted on: 26 Oct 2016 10:38
None of the workarounds worked for me.  Rolled back to 2016_3_914.  Hopefully a fix is in the works.
Michele
Posted on: 24 Oct 2016 12:48
EnableScriptCombine="false"  in iis8.5 windows server 2012R2 not working
in local mode work correctly
Alberto
Posted on: 20 Oct 2016 22:45
<%-- WORKAROUND 1: SET EnableScriptCombine="false" TO RADSCRIPTMANAGER--%>

Did the job. Thanks !