[CLOSED] [1.2] menu not rendered

  1. #1

    [CLOSED] [1.2] menu not rendered

    hi,

    i have problem rendering the menu, please help to inspect

            <ext:Viewport ID="Viewport_SinglePatient" runat="server">
            <Listeners>
                <BeforeRender Handler="Ext.net.DirectMethods.LoadSingleViewData()" />
            </Listeners>
                <Items>
                    <ext:Panel ID="SingleResultHeader" runat="server" Height="60" MaxHeight="60" MinHeight="60" Padding="2">
                        <Items>
                            <ext:Button ID="btnCategoryMenu" runat="server" Text="REPORT ALL" Flat="true">
                                <Menu>
                                    <ext:Menu ID="CategoryMenu" runat="server" ShowSeparator="false" Cls="extmenu">
                                        <Items>
                                            <ext:ComponentMenuItem ID="ComponentMenuItem_CategoryMenu" runat="server" Shift="false">
                                                <Component>
                                                    <ext:Container ID="Container_CategoryMenu" runat="server" Height="128" Layout="HBox" HideMode="Offsets">
                                                        <LayoutConfig>
                                                            <ext:HBoxLayoutConfig Align="Stretch" />
                                                        </LayoutConfig>
                                                    </ext:Container>
                                                </Component>
                                            </ext:ComponentMenuItem>
                                        </Items>
                                    </ext:Menu>
                                </Menu>
                            </ext:Button>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
    code behind
            [Ext.Net.DirectMethod(ShowMask = true, Msg = "Loading....")]
            public void LoadSingleViewData()
            {
                try
                {
                    bool isRender = true;
    
                    if (isRender)
                    {
                        this.Container_CategoryMenu.RemoveAll();
                    }
    
                    Ext.Net.MenuPanel grouppanel = new Ext.Net.MenuPanel();
                    grouppanel.FitHeight = true;
                    grouppanel.Width = 150; //175;
                    grouppanel.IDMode = Ext.Net.IDMode.Explicit;
                    grouppanel.ID = "grouppanel_single" + "_test";
                    grouppanel.SaveSelection = false;
                    grouppanel.Border = false;
    
                    Ext.Net.MenuItem item = new Ext.Net.MenuItem();
                    item.IDMode = Ext.Net.IDMode.Explicit;
                    item.ID = "menu_single" + "_test";
                    item.Text = "test root";
    
                    grouppanel.Menu.ShowSeparator = false;
                    grouppanel.Menu.Items.Add(item);
    
                    this.Container_CategoryMenu.Add(grouppanel);
    
                    grouppanel.Render();
    
                    Container_CategoryMenu.Height = 128;
                    Container_CategoryMenu.Width = 150 * 2;
                }
                catch (Exception ex)
                {
                }
            }
    Last edited by Daniil; Jul 06, 2012 at 10:48 AM. Reason: [CLOSED]
  2. #2
    Hi,

    I can't see where you add the "grouppanel" to anywhere.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    I can't see where you add the "grouppanel" to anywhere.
    sorry, added in code behind.

    tested, but still not rendered.
  4. #4
    Could you demonstrate what exactly you have added?
  5. #5
    Quote Originally Posted by Daniil View Post
    Could you demonstrate what exactly you have added?
    basically i move the menu creation in the code.

    here's are sample expected result (menu populated into the button)

            <ext:Viewport ID="Viewport_SinglePatient" runat="server">
                <Items>
                    <ext:Panel ID="SingleResultHeader" runat="server" Height="60" MaxHeight="60" MinHeight="60" Padding="2">
                        <Items>
                            <ext:Button ID="btnCategoryMenu" runat="server" Text="REPORT ALL" Flat="true">
                                <Menu>
                                    <ext:Menu ID="CategoryMenu" runat="server" ShowSeparator="false" Cls="extmenu">
                                        <Items>
                                            <ext:ComponentMenuItem ID="ComponentMenuItem_CategoryMenu" runat="server" Shift="false">
                                                <Component>
                                                    <ext:Container ID="Container_CategoryMenu" runat="server" Height="128" Width="400" Layout="HBox" HideMode="Offsets">
                                                        <Items>
                                                            <ext:MenuPanel ID="test" runat="server">
                                                                <Menu runat="server" ID="meu">
                                                                    <Items>
                                                                        <ext:MenuItem ID="aaa" runat="server" Text="test"></ext:MenuItem>
                                                                    </Items>
                                                                </Menu>
                                                            </ext:MenuPanel>
                                                        </Items>
                                                        <LayoutConfig>
                                                            <ext:HBoxLayoutConfig Align="Stretch" />
                                                        </LayoutConfig>
                                                    </ext:Container>
                                                </Component>
                                            </ext:ComponentMenuItem>
                                        </Items>
                                    </ext:Menu>
                                </Menu>
                            </ext:Button>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
  6. #6
    Please clarify: did you just demonstrated what you need to get after executing the BeforeRender listener or solve the problem this way?
  7. #7
    Quote Originally Posted by Daniil View Post
    Please clarify: did you just demonstrated what you need to get after executing the BeforeRender listener or solve the problem this way?
    yes, i demonstrate what is the expected result.
    is it possible to do like that?
  8. #8
    Yes, I think it is possible.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void AfterRender(object sender, DirectEventArgs e)
        {
            MenuPanel mp = new MenuPanel();
            mp.Menu.Items.Add(new Ext.Net.MenuItem("Item"));
    
            this.Container1.Items.Add(mp);
            mp.Render();
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Button runat="server" Text="With static menu">
            <Menu>
                <ext:Menu runat="server" ShowSeparator="false">
                    <Items>
                        <ext:ComponentMenuItem runat="server" Shift="false">
                            <Component>
                                <ext:Container
                                    runat="server" 
                                    Height="128" 
                                    Width="400" 
                                    Layout="HBoxLayout">
                                    <LayoutConfig>
                                        <ext:HBoxLayoutConfig Align="Stretch" />
                                    </LayoutConfig>
                                    <Items>
                                        <ext:MenuPanel runat="server">
                                            <Menu runat="server">
                                                <Items>
                                                    <ext:MenuItem runat="server" Text="Item" />
                                                </Items>
                                            </Menu>
                                        </ext:MenuPanel>
                                    </Items>
                                </ext:Container>
                            </Component>
                        </ext:ComponentMenuItem>
                    </Items>
                </ext:Menu>
            </Menu>
        </ext:Button>
    
        <ext:Button ID="Button1" runat="server" Text="With dynamic menu">
            <Menu>
                <ext:Menu runat="server" ShowSeparator="false">
                    <Items>
                        <ext:ComponentMenuItem runat="server" Shift="false">
                            <Component>
                                <ext:Container
                                    ID="Container1" 
                                    runat="server" 
                                    Height="128" 
                                    Width="400" 
                                    Layout="HBoxLayout">
                                    <LayoutConfig>
                                        <ext:HBoxLayoutConfig Align="Stretch" />
                                    </LayoutConfig>
                                </ext:Container>
                            </Component>
                        </ext:ComponentMenuItem>
                    </Items>
                </ext:Menu>
            </Menu>
            <DirectEvents>
                <AfterRender OnEvent="AfterRender" />
            </DirectEvents>
        </ext:Button>
    </body>
    </html>
  9. #9
    figure it out already. is because the layoutconfig.

    thanks. sorry to bother :)

Similar Threads

  1. Replies: 2
    Last Post: Apr 02, 2012, 7:48 AM
  2. [CLOSED] combo in compositefield in menu closing menu on selection
    By smmille1 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 07, 2011, 4:06 PM
  3. [CLOSED] Splitbutton with Menu - Make the menu expand upwards?
    By rbarr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 02, 2011, 1:18 PM
  4. [CLOSED] Menu inside Component menu item
    By tansu in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 15, 2010, 2:32 PM
  5. [CLOSED] [1.0] MVC sample west menu has no menu items
    By Inoventus in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Nov 24, 2009, 4:06 AM

Posting Permissions