I've got a web page with a script that opens radwindows for me with an onclose .
The radwindow has a radgrid with a radmenu.
These are the scripts on the radwindow that close and pass back arguments for me
this is the script on the parent window that handles the onclose method
the problem I am having is after the Archive_OnClose finishes I am getting the following error and am not sure how to get rid of it. By the time this error occurs, the radwindow has already closed and the onclose method has already fired so not sure why it is happening. All the debuggers have been hit
the error is on the last line and its
Microsoft JScript runtime error: '$telerik' is undefined
function openPatientDemoWin(url, title, AddOnClose, OnCloseMethod) {
var Wnd = radopen(url, 'frank');
Wnd.set_title(title);
Wnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Resize);
Wnd.set_autoSize(true);
Wnd.set_modal(true);
Wnd.set_visibleStatusbar(false);
Wnd.set_destroyOnClose(true);
if (AddOnClose == '1') {
Wnd.add_close(OnCloseMethod);
}
return false;
}
The radwindow has a radgrid with a radmenu.
this is the radmenu in the radgrid, the items are added in the codebehind so I can attach attributes to them
<
telerik:RadMenu
ID
=
"RadMenu1"
runat
=
"server"
OnClientItemClicked
=
"RadMenu1_onClicked"
>
<
Items
>
<
telerik:RadMenuItem
ImageUrl
=
"/images/icon_actionmenu.gif"
BorderStyle
=
"None"
BorderWidth
=
"0px"
>
<
GroupSettings
ExpandDirection
=
"Right"
></
GroupSettings
>
<
Items
>
</
Items
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenu
>
These are the scripts on the radwindow that close and pass back arguments for me
<
script
type
=
"text/javascript"
>
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
function RadMenu1_onClicked(sender, args) {
var item = args.get_item();
var MenuItem = item.get_attributes().getAttribute("MenuItem");
var DueDateID = item.get_attributes().getAttribute("DueDateID");
var oArg = new Object();
oArg.MenuItem = MenuItem;
oArg.DueDateID = DueDateID;
var oWnd = GetRadWindow();
oWnd.close(oArg);
}
</
script
>
this is the script on the parent window that handles the onclose method
function Archive_OnClose(oWnd, args) {
debugger;
var arg = args.get_argument();
debugger;
if (arg) {
switch (arg.MenuItem) {
case '17P':
break;
case 'RISK':
break;
case 'PH':
debugger;
window.location = '/OB/OBAssessmentsList.aspx?AM=wfe34tgsdge4&ADD=' + arg.DueDateID;
debugger;
break;
}
}
debugger;
}
the problem I am having is after the Archive_OnClose finishes I am getting the following error and am not sure how to get rid of it. By the time this error occurs, the radwindow has already closed and the onclose method has already fired so not sure why it is happening. All the debuggers have been hit
this._renderAccessKey();
b.RadMenu._updateChildrenPositionClass(this.get_parent());
b.RadMenu._updateChildrenPositionClass(this);
},get_linkElement:function(){if(!this._linkElement){this._linkElement=$telerik.getFirstChildByTagName(this.get_element(),"a",0);
the error is on the last line and its
Microsoft JScript runtime error: '$telerik' is undefined