Opening Multiple RadWindows using RibbonButton Clicks

3 posts, 0 answers
  1. Michael
    Michael avatar
    43 posts
    Member since:
    Mar 2013

    Posted 14 Mar 2013 Link to this post

    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. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 14 Mar 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Michael
    Michael avatar
    43 posts
    Member since:
    Mar 2013

    Posted 14 Mar 2013 Link to this post

    That is just what I needed thanks!
Back to Top