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

Opening Multiple RadWindows using RibbonButton Clicks

2 Answers 37 Views
Window
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 14 Mar 2013, 02:36 PM
How do you create a new instance of a RadWindow using Javascript, I am trying to create multiple RadWindows based on the CommandName of the Button on the Ribbon. For example, a button called "Create Chart" will open a new window of a chart, and the user can click "Create Grid" to display a grid window, both of the windows should be on the page. And I am trying to do this without a postback...which is why I want to create them using Javascript.

Here is the function I am trying

function dsxRibbonBar_ButtonClicked(sender,args)
{
 var windowType = args.get_commandName();//How do I get the the button command name? 
 alert(windowType);
}


Thanks in advance.



Michael

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 14 Mar 2013, 03:29 PM
Hello Michael,

The following help article explains how you can open multiple RadWindows on the client without having them declared on the page: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html. Passing null as a second argument to radopen() will create a new one each time, if you pass a name it will create a named instance that you can later reuse by supplying the same name.

On working with the radRibbonBar I advise you examine the followng resources:
http://www.telerik.com/help/aspnet-ajax/ribbonbar-client-buttonclicking.html - on using a cancellable event so you can prevent the postback for specific buttons
When you have the button you can use its get_commandName() method to get the command. You should end up with args.get_button().get_commandName() where args is the second argument the handler receives.



All the best,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Michael
Top achievements
Rank 1
answered on 14 Mar 2013, 03:40 PM
That is just what I needed thanks!
Tags
Window
Asked by
Michael
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Michael
Top achievements
Rank 1
Share this question
or