Completed
Last Updated: 14 Mar 2014 16:15 by ADMIN
ADMIN
Marin Bratanov
Created on: 10 Feb 2014 11:12
Category: UI for ASP.NET AJAX
Type: Bug Report
0
FIX RadGrid exporting inside an iframe (RadWindow) when RadMenu is present on the page
When RadMenu is present on the page where a RadGrid has to be exported, a JavaScript error is thrown when the response is received. This is observable only in an iframe (or, therefore, a RadWindow).

Different ways to work around this are:

- remove the menu/context menu

- use a regular browser window instead of a RadWindow for this page

- use the ContentTemplate of the RadWindow instead of loading an entire page in it

- try adding the following function override at the end of the content page, just before the closing form tag:
			Telerik.Web.UI.RadMenu.prototype._onMouseOut = function (e)
			{
				var relatedTarget = e.rawEvent.relatedTarget ? e.rawEvent.relatedTarget : e.rawEvent.toElement;

				if (!relatedTarget && !this._isMainElementDescendant(e.target))
				{
					//The mouse is out of the window or the current frame - close the menu
					try
					{
						var that = this;
						setTimeout(
							function ()
							{
								that.close();
							}, this.get_collapseDelay());
					}
					catch (e)
					{
					
					}
				}
			}

If this does not help, try adding this one below:
$telerik.addHandler = function (element, eventName, handler, autoRemove) {
				if (!element._events)
					element._events = {};
			
				var eventCache = element._events[eventName];
				if (!eventCache)
					element._events[eventName] = eventCache = [];
			
				var browserHandler;
				if ($telerik.useAttachEvent(element)) {
					browserHandler = function() {
						var e = {};
						try {
							e = $telerik._getWindow(element).event
						}
						catch (ex) {
						}
						try {
							return handler.call(element, new Sys.UI.DomEvent(e));
						}
						catch (e) {
							
						}
					}
					element.attachEvent('on' + eventName, browserHandler);
				}
				else if (element.addEventListener) {
					browserHandler = function(e) {
						return handler.call(element, new Sys.UI.DomEvent(e));
					}
					element.addEventListener(eventName, browserHandler, false);
				}
			
				eventCache[eventCache.length] = { handler: handler, browserHandler: browserHandler, autoRemove: autoRemove };
				if (autoRemove) {
					var d = element.dispose;
					if (d !== $telerik._disposeHandlers) {
						element.dispose = $telerik._disposeHandlers;
						if (typeof(d) !== "undefined")
							element._chainDispose = d;
					}
				}
			}
0 comments