[CLOSED] How to add 2 toolbar in GridPanel TopBar?

  1. #1

    [CLOSED] How to add 2 toolbar in GridPanel TopBar?

    Hi all,
    i want to add 2 toolbar in GridPanel TopBar? but it gives error "Only one item is allowed in this Collection".
                        <TopBar>
                            <ext:Toolbar ID="extTopToolbar" runat="server">
                            </ext:Toolbar>
                            <ext:Toolbar ID="Toolbar1" runat="server">
                            </ext:Toolbar>
                        </TopBar>
    Last edited by Daniil; Nov 15, 2013 at 2:44 PM. Reason: [CLOSED]
  2. #2
    What about something like this? I am not sure if this is the best solution here:


    
                <TopBar>
                    <ext:Toolbar ID="Toolbar1" runat="server" Layout="FitLayout">
                        <Items>
                            <ext:Container Layout="VBoxLayout">
                                <LayoutConfig>
                                    <ext:VBoxLayoutConfig Align="Stretch" />
                                </LayoutConfig>
                                <Items>
                                    <ext:Toolbar>
                                        <Items>
                                            <ext:Button />
                                            <ext:Button />
                                            <ext:Button />
                                        </Items>
                                    </ext:Toolbar>
                                    <ext:Toolbar>
                                        <Items>
                                            <ext:Button />
                                            <ext:Button />
                                            <ext:Button />
                                        </Items>
                                    </ext:Toolbar>
                                </Items>
                            </ext:Container>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
  3. #3
    Hi everybody,

    It is better to use DockedItems.
    <ext:Panel runat="server">
        <DockedItems>
            <ext:Toolbar runat="server" Dock="Top">
                <Items>
                    <ext:Button runat="server" Text="Button" />
                </Items>
            </ext:Toolbar>
            <ext:Toolbar runat="server" Dock="Top">
                <Items>
                    <ext:Button runat="server" Text="Button" />
                </Items>
            </ext:Toolbar>
        </DockedItems>
    </ext:Panel>
    Actually, TopBar is a short-hand for a top docked item.
  4. #4
    thanks all for help,
    i did this like
                       <TopBar>
                            <ext:Toolbar ID="Toolbar2" runat="server" Flex="1">
                                <Items>
                                    <ext:Panel ID="pnl" Flex="1" runat="server">
                                        <Items>
                                            <ext:Toolbar ID="extTopToolbar" runat="server" Flex="1">
                                                <Items>
                                                    <ext:Button ID="Button1" runat="server" Text="Save">
                                                    </ext:Button>
                                                 </Items>
                                            </ext:Toolbar>
                                            <ext:Toolbar ID="Toolbar1" runat="server" Flex="1">
                                                <Items>
                                                    <ext:Button ID="Button2" runat="server" Text="update">
                                                    </ext:Button>
                                                 </Items>
                                            </ext:Toolbar>
                                        </Items>
                                    </ext:Panel>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
  5. #5
    hi @Daniil,
    please set it's status as closed.
  6. #6
    Well, your solution is OK, but a small tip - the less controls, the better performance.

    I mean that there are 4 controls (Panel and 3 Toolbars) in your solution, but just 2 (Toolbars) in mine. Well, it doesn't affect the performance in this simple example. But when the applications grows, it becomes more and more important.
    Last edited by Daniil; Nov 15, 2013 at 2:51 PM.

Similar Threads

  1. [CLOSED] replacing topBar (toolbar) of Panel
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 15, 2013, 4:28 PM
  2. Replies: 2
    Last Post: Jul 29, 2012, 12:19 PM
  3. Replies: 7
    Last Post: Sep 28, 2011, 7:56 AM
  4. Replies: 1
    Last Post: Mar 07, 2011, 9:39 AM
  5. [FIXED] [0.8.2] Toolbar and Topbar
    By Timothy in forum Bugs
    Replies: 2
    Last Post: Oct 12, 2009, 11:11 AM

Tags for this Thread

Posting Permissions