keep menu open

7 posts, 0 answers
  1. cprieto
    cprieto avatar
    7 posts
    Member since:
    Jul 2007

    Posted 08 Sep 2008 Link to this post

    Hello,

    I've been trying to keep a menu open after a selection of an item (the menu has checkbox stuff and I need to allow the user to select the items before close it).

    So far I only can get that behavior creating a fake function and generating a javascript error:

    <telerik:RadContextMenu ID="contextColumns" runat="server" Flow="Vertical" Skin="Hay" OnClientItemClicked="OnMenuClick"
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            <Items> 
                <telerik:RadMenuItem runat="server" Text="Show Columns" Value="Columns"
                    <Items> 
                        <telerik:RadMenuItem runat="server" Text="Id" State="checked" /> 
                        <telerik:RadMenuItem runat="server" Text="First Name" State="checked" /> 
                        <telerik:RadMenuItem runat="server" Text="Last Name" State="checked" /> 
                        <telerik:RadMenuItem runat="server" IsSeparator="true" /> 
                        <telerik:RadMenuItem runat="server" Text="Apply" Value="menuApply" /> 
                    </Items> 
                </telerik:RadMenuItem> 
                </telerik:RadMenuItem> 
            </Items> 
    </telerik:RadContextMenu> 

    And this is the way I try to do it in js:

    function OnMenuClicked(sender, args) { 
       var item = args.get_item(); 
       switch(item.get_value()) { 
           case "menuApply" : 
              // Here I need to apply changes and that's all 
           break
           default : 
              ToggleCheckImage(item); 
              this_function_does_not_exists();  // the only way to keep the menu open 
       } 

    The user need to select the items in the menu and then apply the changes when select "Apply", the only way I could keep the menu open until the user select apply is using a simple javascript error.

    Is any better way to do what I want? just to keep the menu displayed until the user select the correct menu option?

    Thanks a lot for your help!


  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 09 Sep 2008 Link to this post

    Hi kementeus,

    RadContextMenu does not support this scenario. Clicking an item is always closing the menu.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 12 Sep 2008 Link to this post

    I have also asked this question long time ago. I've another situation where I need such functionality.

    Isn't it possible to fire a javascript e.g. to expand the menu after the page_load?

    I would really like some help regarding this issue.

    Thanks,
    Daniel
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 15 Sep 2008 Link to this post

    Hello Daniel,

    We have this online demo which shows how to open a menu after postback.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 15 Sep 2008 Link to this post

    Hi Albert,

    Thanks for the info.
    However, is it possible to do this automatically? So when a menu item is pressed, the script fires?

    Daniel
  7. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 15 Sep 2008 Link to this post

    Hi Daniel,

    You can modify the example to do so. For example you can use this code in the ItemClick event handler of your menu:

    ScriptManager.RegisterHiddenField(this, "HiddenField1", e.Item.Text);

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 15 Sep 2008 Link to this post

    Okay, thanks. I will try to figure it out. I'm using the r.a.d.menu in Sitefinity, so that probably works something different.

    Daniel
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017