is there a way to open a new browser window when the user clicks on a ribbon button?
Thnx.
5 Answers, 1 is accepted
You can use the OnClientButtonClicking client-side event and open a new window by applying the following javascript function (please take a look at this demo where the described approach is exemplified):
function
OnClientButtonClicking(sender, args) {
window.open(
"http://www.telerik.com"
,
"WindowPopup"
,
"width=400px, height=400px, resizable"
);
}
Best wishes,
Kate
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
How can I get the ID from the button to check if this is the button to start a new window?
function
OnClientButtonClicking(sender, args) {
var button = args.get_button();
var text = button.tostring;
alert(text);
if (text == "btnOpenWebsite") {
window.open(
http://www.telerik.com, "WindowPopup", "width=400px, height=400px, resizable");
}
}
You can find a button by text using the following javascript function:
<script type=
"text/javascript"
>
function
OnClientButtonClicking(sender, args) {
var
button = args.get_button();
if
(button.get_text() ==
"New"
) {
window.open(
"http://www.telerik.com"
,
"WindowPopup"
,
"width=400px, height=400px, resizable"
);
}
}
</script>
Regards,
Kate
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
We have not implemented such function but you can easily assign unique values to the buttons and use the get_value() client-side function in order to get the needed element.
Best wishes,
Kate
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.