It seems as if args.get_eventTarget() no longer works in the Q2 2009 release. All i get is a Javascript error stating that 'undefined' is null or not an object. This page used to work fine, now it doesn't. Any suggestions??
Thanks!
Thanks!
4 Answers, 1 is accepted
0
jfkrueger
Top achievements
Rank 1
answered on 11 Aug 2009, 07:07 PM
After further review it looks like args is 'undefined'. What would be causing this???
| function centerUpdatePanel(sender, args) { |
| //centerElementOnScreen(document.getElementById("ctl00_ctl00_MainContent_MainContent_ClaimsControl_RadLoadingPanelMain")); |
| alert(args); |
| //if (args.EventTarget.indexOf("ButtonExportClaimsToExcel") != -1 || args.EventTarget.indexOf("ButtonClaimDetailsExport") != -1) { |
| // args.EnableAjax = false; |
| //} |
| } |
0
Hello Joe,
I'm unable to reproduce the issue on my end. Please notice, that the following online demos rely on the get_eventTarget property (Q2 2009):
Export to PDF online demo
File Upload online demo
Regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I'm unable to reproduce the issue on my end. Please notice, that the following online demos rely on the get_eventTarget property (Q2 2009):
Export to PDF online demo
File Upload online demo
Regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
jfkrueger
Top achievements
Rank 1
answered on 12 Aug 2009, 03:57 PM
| <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="AjaxPanelTest.aspx.vb" Inherits="MiBenefits.AjaxPanelTest" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" > |
| <head runat="server"> |
| <title></title> |
| <script type="text/javascript"> |
| function centerUpdatePanel(sender, args) { |
| centerElementOnScreen(document.getElementById("RadLoadingPanelMain")); |
| alert(args); |
| } |
| function centerElementOnScreen(element) { |
| var scrollTop = document.body.scrollTop; |
| var scrollLeft = document.body.scrollLeft; |
| var viewPortHeight = document.body.clientHeight; |
| var viewPortWidth = document.body.clientWidth; |
| if (document.compatMode == "CSS1Compat") { |
| viewPortHeight = document.documentElement.clientHeight; |
| viewPortWidth = document.documentElement.clientWidth; |
| scrollTop = document.documentElement.scrollTop; |
| scrollLeft = document.documentElement.scrollLeft; |
| } |
| var topOffset = Math.ceil(viewPortHeight / 2 - element.offsetHeight / 2); |
| var leftOffset = Math.ceil(viewPortWidth / 2 - element.offsetWidth / 2); |
| var top = scrollTop + topOffset - 40; |
| var left = scrollLeft + leftOffset - 70; |
| element.style.position = "absolute"; |
| element.style.top = top + "px"; |
| element.style.left = left + "px"; |
| } |
| </script> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManagerMain" runat="server"> |
| </telerik:RadScriptManager> |
| <div> |
| <telerik:RadAjaxLoadingPanel ID="RadLoadingPanelMain" runat="server" IsSticky="false" InitialDelayTime="0" Skin="WebBlue"> |
| </telerik:RadAjaxLoadingPanel> |
| <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadLoadingPanelMain" ClientEvents-OnRequestStart="centerUpdatePanel();" > |
| <asp:Button ID="ButtonSubmit" runat="server" Text="Click Me" /> |
| <asp:Panel ID="PanelTest" runat="server" Visible="false"> |
| <asp:Label ID="LabelTest" runat="server" Text="Hi!"></asp:Label> |
| </asp:Panel> |
| </telerik:RadAjaxPanel> |
| </div> |
| </form> |
| </body> |
| </html> |
In this code, args is 'undefined'. Pretty straight-forward example. Standard HTML page, no master pages or user controls. So what am i doing wrong? It works on some pages and not on others.
0
Hi Joe,
To attach client-side event you need to specify only function name instead of trying to execute the function:
ClientEvents-OnRequestStart="centerUpdatePanel();"
should be:
ClientEvents-OnRequestStart="centerUpdatePanel"
Best wishes,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
To attach client-side event you need to specify only function name instead of trying to execute the function:
ClientEvents-OnRequestStart="centerUpdatePanel();"
should be:
ClientEvents-OnRequestStart="centerUpdatePanel"
Best wishes,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
