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

open in new window

5 Answers 51 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Sander Wijnen
Top achievements
Rank 1
Sander Wijnen asked on 30 Jul 2011, 05:00 PM
Hi,

is there a way to open a new browser window when the user clicks on a ribbon button?
Thnx.

5 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 02 Aug 2011, 05:07 PM
Hi Sander Wijnen,

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.

0
Sander Wijnen
Top achievements
Rank 1
answered on 05 Aug 2011, 02:21 PM

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");

}

}

0
Kate
Telerik team
answered on 05 Aug 2011, 04:00 PM
Hello Sander,

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.

0
Sander Wijnen
Top achievements
Rank 1
answered on 05 Aug 2011, 04:09 PM
thnx, is there also an function to get the UniqueID ? because that's safer to use, with all the button texts.


0
Kate
Telerik team
answered on 08 Aug 2011, 12:31 PM
Hi Sander ,

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.

Tags
RibbonBar
Asked by
Sander Wijnen
Top achievements
Rank 1
Answers by
Kate
Telerik team
Sander Wijnen
Top achievements
Rank 1
Share this question
or