This is a migrated thread and some comments may be shown as answers.

Call javascript function on action

7 Answers 361 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Saima Gul
Top achievements
Rank 1
Saima Gul asked on 01 Jan 2011, 10:15 AM
Hi
i have downloaded latest version of telerik reports released on Report Q3 2010. thanks for new features
I want to open a new window of specific record when user click on image. We can use action for it. I define a javascript function which accept RecordId as parameter
function openWin(id)
{
window.open("mypage.aspx?employeeId="+id);
}
This javascript function is in my aspx file where i have placed ReportViewer Control
on action of image i select Navigate to url if i write javascript:alert('ok') it works fine and display alert
Now how can i call my javascript function defined in my aspx page and how pass parameter for each row

7 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 03 Jan 2011, 12:41 PM
Hello Saima,

Currently specifying custom actions is not allowed, but we have logged this as a feature request and would work on it for subsequent version of the product.

Sorry for the temporary inconvenience.

Kind regards,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
Giuliano Caetano
Top achievements
Rank 1
answered on 01 Feb 2012, 11:05 PM
I Steve,
I had this works on 2011 Q2, because the Action propertie from TextBox rendered in HTML something like this: 
<a href='javascript:nameFunction()'> <a/>, so, the href property from this tag called any javascrip function.

In Q3 2011, this was modified, the Action property from TextBox, render something like this:

<div class="action" style="left:206px;top:364px;width:445px;height:15px;" onclick="javascript:NavigateToUrl('http://maps.google.com/maps?q=38.754722,-9.375611', '_blank');"></div>

and we lose many feature on reports, already on production. So, how can we solve this problem?

Any answer will be greatly appreciated.

Thanks
gcaetano
0
Steve
Telerik team
answered on 02 Feb 2012, 09:01 AM
Hello Giuliano,

Custom actions would no longer function with Q3 2011 release as hyperlink actions are no longer rendered as <a href>, rather they use javascript function like so:

function NavigateToUrl(Url, target)
{
     window.open(Url, target);
}

We have not removed it purposely, but the revamping of HTML rendering we did for the Q3 release required those changes. We had them in mind for quite some time and that is why we warned users that the approach used till now is only a temporary hack.
Additionally as always we aim to be consistent among all viewers/formats and the hack for "custom actions" was only applicable for the ASP.NET viewer. Clients that used other technology did not have a way to get this done which is bad. There is no other *hack* for the time being. If we implement custom actions for future versions, this would be indicated in our Roadmap.

Regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Giuliano Caetano
Top achievements
Rank 1
answered on 02 Feb 2012, 01:57 PM
Hi Steve,
Thanks for your answer...
It is so bad news and affects future plans... With this way I lose may features on reports. 
Is possible override the function NavigateToUrl to minimize this impact?

Tks
gcaetano
0
Steve
Telerik team
answered on 06 Feb 2012, 02:04 PM
Hello Giuliano,

There is no other *hack* for the time being. If we implement custom actions for future versions, this would be indicated in our Roadmap.

Kind regards,
Steve
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Fournier
Top achievements
Rank 1
answered on 08 Feb 2012, 10:48 AM
Hello Steve,

We are having the same problem. We have several reports on production with this functionality and all stopped working. When will we have this problem resolved? It's an urgent issue because if it will not be resolved soon we'll have to change for another report api.

Best regards,
Fournier,
Sedimap
0
Steve
Telerik team
answered on 10 Feb 2012, 04:26 PM
Hello Fournier,

Just for clarify, we would like to note once again that reports never officially had or supported custom actions. What you had working in your web applications with older versions was a hack that was applicable only for web projects and when exported these reports would contain invalid actions. Meaning that you have a report that contains some kind of "commands" for your application that are not valid from outside the application. We would suggest extracting these actions from the reports to the application. This way the reports will contain only the relevant information and will be really portable - that is you can export them to PDF or Excel and can open them outside your application.

We cannot engage with a time frame for custom actions functionality and if this is important for your project, we recommend sticking to the Q2 2011 version where you have a possible solution.

Thank you for the understanding.

Kind regards,
Steve
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
General Discussions
Asked by
Saima Gul
Top achievements
Rank 1
Answers by
Steve
Telerik team
Giuliano Caetano
Top achievements
Rank 1
Fournier
Top achievements
Rank 1
Share this question
or