[FIXED] [#711] [3.2.0] ToolBar overflow

Page 1 of 2 12 LastLast
  1. #1

    [FIXED] [#711] [3.2.0] ToolBar overflow

    On the following example, click on show overflowed items button


    Then resize window, wide enough that there is no overflowed items


    On version 2.x, overflowed items are collapsed prior resizing.

    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
    </head>
    <body>
        <ext:ResourceManager  Theme="Gray" runat="server" />
        <ext:Window Title="Window" Width="200" Height="200" BodyPadding="10" AutoScroll="true" Html="Content" runat="server">
            <TopBar>
                <ext:Toolbar EnableOverflow="true" runat="server">
                    <Items>
                        <ext:Button Text="Button 1" Icon="Accept" runat="server" />
                        <ext:Button Text="Button 2" Icon="Add" runat="server" />
                        <ext:Button Text="Button 3" Icon="Anchor" runat="server" />
                        <ext:Button Text="Button 4" Icon="Application" runat="server" />
                        <ext:Button Text="Button 5" Icon="ArrowBranch" runat="server" />
                    </Items>
                </ext:Toolbar>
            </TopBar>
        </ext:Window>
    </body>
    </html>
    Attached Thumbnails Click image for larger version. 

Name:	ov001.png 
Views:	7 
Size:	3.8 KB 
ID:	20101   Click image for larger version. 

Name:	ov002.png 
Views:	6 
Size:	4.4 KB 
ID:	20102  
    Last edited by Daniil; Jun 23, 2015 at 2:52 PM. Reason: [FIXED] [#711] [3.2.0]
  2. #2
    Hello Raphael!

    Thank you very much for your reports (not just this but the others as well). While it is sad to see so many issues, I am glad this was found while the version is still not released/stable.

    I mean, I couldn't reproduce the error in the 3.0 version. I'll be investigating this issue and will make sure to have a fix for this applied soon.

    Thanks again, and keep'em coming! :)

    EDIT:

    Additionally, I could reproduce the issue looking on these two ExtJS samples:
    Toolbars with menus (5.0.0)
    Toolbars with menus (5.1.0)

    So, we'll probably patching ExtJS in order to fix this issue.
    Last edited by fabricio.murta; Feb 03, 2015 at 2:20 AM.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    It could help you to avoid the glitch:

                <ext:Toolbar runat="server">
                    <LayoutConfig>
                        <ext:LayoutConfig>
                            <CustomConfig>
                                <ext:ConfigItem Name="overflowHandler" Value="scroller" />
                            </CustomConfig>
                        </ext:LayoutConfig>
                    </LayoutConfig>
                    <Items>
                        <ext:Button Text="Button 1" Icon="Accept" runat="server" />
                        <ext:Button Text="Button 2" Icon="Add" runat="server" />
                        <ext:Button Text="Button 3" Icon="Anchor" runat="server" />
                        <ext:Button Text="Button 4" Icon="Application" runat="server" />
                        <ext:Button Text="Button 5" Icon="ArrowBranch" runat="server" />
                    </Items>
                </ext:Toolbar>
    Instead of dropdown, slideable toolbar overflow, notice I omitted the EnableOverflow toolbar parameter. Its kind of a nice alternative as well, you may like it.
    Fabrício Murta
    Developer & Support Expert
  4. #4
    I prefer the following notation
    <ext:Toolbar OverflowHandler="Scroller" runat="server">
        <Items>
            <ext:Button Text="Button 1" Icon="Accept" runat="server" />
            <ext:Button Text="Button 2" Icon="Add" runat="server" />
            <ext:Button Text="Button 3" Icon="Anchor" runat="server" />
            <ext:Button Text="Button 4" Icon="Application" runat="server" />
            <ext:Button Text="Button 5" Icon="ArrowBranch" runat="server" />
        </Items>
    </ext:Toolbar>
  5. #5
  6. #6
    Hello everybody,

    Yes, there was a lot of changes regarding focusing/bluring in ExtJS 5.1.0. I guess it is one issue more caused by the changes. Created an Issue:
    https://github.com/extnet/Ext.NET/issues/711

    As a workaround (besides getting rid of EnableOverflow at all) I could suggest:
    <ext:Window ...>
        ...
        <Listeners>
            <AfterLayout Handler="this.down('toolbar[enableOverflow]').layout.overflowHandler.menu.hide();" />
        </Listeners>
    </ext:Window>
  7. #7
    Daniil, i confirm that your workaround overcomes the issue.

    On my application i noticed the issue when resizing viewport. It's also possible to overcome it by using your workaround.

    Click image for larger version. 

Name:	mn001.png 
Views:	3 
Size:	10.5 KB 
ID:	21221

    Click image for larger version. 

Name:	mn002.png 
Views:	2 
Size:	10.8 KB 
ID:	21231
    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
    </head>
    <body>
        <ext:ResourceManager Theme="Gray" runat="server" />
        <ext:Viewport Layout="BorderLayout" Border="false" runat="server">
            <Items>
                <%--CENTER--%>
                <ext:Panel Title="Center" Region="Center" Html="Content" Split="true" runat="server">
                    <TopBar>
                        <ext:Toolbar EnableOverflow="true" runat="server">
                            <Items>
                                <ext:Button Text="Button 1" Icon="FlagAd" runat="server" />
                                <ext:Button Text="Button 2" Icon="FlagAe" runat="server" />
                                <ext:Button Text="Button 3" Icon="FlagAf" runat="server" />
                                <ext:Button Text="Button 4" Icon="FlagAg" runat="server" />
                                <ext:Button Text="Button 5" Icon="FlagAi" runat="server" />
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                </ext:Panel>
                <%--EAST--%>
                <ext:Panel Title="East" Region="East" Html="Content" Width="300" Split="true" runat="server">
                    <TopBar>
                        <ext:Toolbar EnableOverflow="true" runat="server">
                            <Items>
                                <ext:Button Text="Button 1" Icon="FlagAd" runat="server" />
                                <ext:Button Text="Button 2" Icon="FlagAe" runat="server" />
                                <ext:Button Text="Button 3" Icon="FlagAf" runat="server" />
                                <ext:Button Text="Button 4" Icon="FlagAg" runat="server" />
                                <ext:Button Text="Button 5" Icon="FlagAi" runat="server" />
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                </ext:Panel>
            </Items>
        </ext:Viewport>
    </body>
    </html>
    So, we'd have the following
    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
    </head>
    <body>
        <ext:ResourceManager Theme="Gray" runat="server" />
        <ext:Viewport Layout="BorderLayout" Border="false" runat="server">
            <Items>
                <%--CENTER--%>
                <ext:Panel Title="Center" Region="Center" Html="Content" Split="true" runat="server">
                    <TopBar>
                        <ext:Toolbar EnableOverflow="true" runat="server">
                            <Items>
                                <ext:Button Text="Button 1" Icon="FlagAd" runat="server" />
                                <ext:Button Text="Button 2" Icon="FlagAe" runat="server" />
                                <ext:Button Text="Button 3" Icon="FlagAf" runat="server" />
                                <ext:Button Text="Button 4" Icon="FlagAg" runat="server" />
                                <ext:Button Text="Button 5" Icon="FlagAi" runat="server" />
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Listeners>
                        <AfterLayout Handler="this.down('toolbar[enableOverflow]').layout.overflowHandler.menu.hide();" />
                    </Listeners>
                </ext:Panel>
                <%--EAST--%>
                <ext:Panel Title="East" Region="East" Html="Content" Width="300" Split="true" runat="server">
                    <TopBar>
                        <ext:Toolbar EnableOverflow="true" runat="server">
                            <Items>
                                <ext:Button Text="Button 1" Icon="FlagAd" runat="server" />
                                <ext:Button Text="Button 2" Icon="FlagAe" runat="server" />
                                <ext:Button Text="Button 3" Icon="FlagAf" runat="server" />
                                <ext:Button Text="Button 4" Icon="FlagAg" runat="server" />
                                <ext:Button Text="Button 5" Icon="FlagAi" runat="server" />
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Listeners>
                        <AfterLayout Handler="this.down('toolbar[enableOverflow]').layout.overflowHandler.menu.hide();" />
                    </Listeners>
                </ext:Panel>
            </Items>
        </ext:Viewport>
    </body>
    </html>
  8. #8
    Thank you for the quick follow-up!

    I was thinking to commit such a fix to SVN:
    Ext.define('Ext.overrides.menu.Menu', {
        override: 'Ext.menu.Menu',
    
        onShow: function () {
            this.callParent(arguments);
            this.focus();
        }
    });
    But decided not to commit.

    First, it doesn't fix all the known cases. It fixes some scenarios, but it doesn't fix the scenario that you reported.
    Second, I am not sure it doesn't cause other problems (and, maybe, even more).

    We hope it will be fixed in ExtJS 5.1.1. For now, we keep the issue in mind and ready to provide members with workarounds once something related is reported on the forums.
  9. #9
    It's possible to overcome the issue by doing the following:
    <script type="text/javascript">
        Ext.container.Container.override({
            afterLayout: function (layout) {
                this.callParent(arguments);
                if (layout != null && layout.overflowHandler != null && layout.overflowHandler.menu != null) {
                    layout.overflowHandler.menu.hide();
                }
            }
        });
    </script>
    It's a stable workaround and fixes all known cases. It's up to you whether it should be committed to SVN.

    Standard Toolbar
    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
        <script type="text/javascript">
            Ext.container.Container.override({
                afterLayout: function (layout) {
                    this.callParent(arguments);
                    if (layout != null && layout.overflowHandler != null && layout.overflowHandler.menu != null) {
                        layout.overflowHandler.menu.hide();
                    }
                }
            });
        </script>
    </head>
    <body>
        <ext:ResourceManager Theme="Gray" ScriptMode="Debug" runat="server" />
        <ext:Window Title="Window" Width="200" Height="200" BodyPadding="10" AutoScroll="true" Html="Content" runat="server">
            <TopBar>
                <ext:Toolbar EnableOverflow="true" runat="server">
                    <Items>
                        <ext:Button Text="Button 1" Icon="Accept" runat="server" />
                        <ext:Button Text="Button 2" Icon="Add" runat="server" />
                        <ext:Button Text="Button 3" Icon="Anchor" runat="server" />
                        <ext:Button Text="Button 4" Icon="Application" runat="server" />
                        <ext:Button Text="Button 5" Icon="ArrowBranch" runat="server" />
                    </Items>
                </ext:Toolbar>
            </TopBar>
        </ext:Window>
    </body>
    </html>
    Docked Toolbar - Top, Left, Right and Button
    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
        <script type="text/javascript">
            Ext.container.Container.override({
                afterLayout: function (layout) {
                    this.callParent(arguments);
                    if (layout != null && layout.overflowHandler != null && layout.overflowHandler.menu != null) {
                        layout.overflowHandler.menu.hide();
                    }
                }
            });
        </script>
    </head>
    <body>
        <ext:ResourceManager Theme="Gray" ScriptMode="Debug" runat="server" />
        <ext:Window Title="Window" Width="200" Height="200" BodyPadding="10" AutoScroll="true" Html="Content" runat="server">
            <DockedItems>
                <ext:Toolbar EnableOverflow="true" Dock="Top" runat="server">
                    <Items>
                        <ext:Button Text="Button 1" Icon="Accept" runat="server" />
                        <ext:Button Text="Button 2" Icon="Add" runat="server" />
                        <ext:Button Text="Button 3" Icon="Anchor" runat="server" />
                        <ext:Button Text="Button 4" Icon="Application" runat="server" />
                        <ext:Button Text="Button 5" Icon="ArrowBranch" runat="server" />
                    </Items>
                </ext:Toolbar>
            </DockedItems>
        </ext:Window>
    </body>
    </html>
    Toolbar within ViewPort
    <!DOCTYPE html>
    <html>
    <head id="Head2" runat="server">
        <script type="text/javascript">
            Ext.container.Container.override({
                afterLayout: function (layout) {
                    this.callParent(arguments);
                    if (layout != null && layout.overflowHandler != null && layout.overflowHandler.menu != null) {
                        layout.overflowHandler.menu.hide();
                    }
                }
            });
        </script>
    </head>
    <body>
        <ext:ResourceManager Theme="Gray" runat="server" />
        <ext:Viewport Layout="BorderLayout" Border="false" runat="server">
            <Items>
                <%--CENTER--%>
                <ext:Panel Title="Center" Region="Center" Html="Content" Split="true" runat="server">
                    <TopBar>
                        <ext:Toolbar EnableOverflow="true" runat="server">
                            <Items>
                                <ext:Button Text="Button 1" Icon="FlagAd" runat="server" />
                                <ext:Button Text="Button 2" Icon="FlagAe" runat="server" />
                                <ext:Button Text="Button 3" Icon="FlagAf" runat="server" />
                                <ext:Button Text="Button 4" Icon="FlagAg" runat="server" />
                                <ext:Button Text="Button 5" Icon="FlagAi" runat="server" />
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                </ext:Panel>
                <%--EAST--%>
                <ext:Panel Title="East" Region="East" Html="Content" Width="300" Split="true" runat="server">
                    <TopBar>
                        <ext:Toolbar EnableOverflow="true" runat="server">
                            <Items>
                                <ext:Button Text="Button 1" Icon="FlagAd" runat="server" />
                                <ext:Button Text="Button 2" Icon="FlagAe" runat="server" />
                                <ext:Button Text="Button 3" Icon="FlagAf" runat="server" />
                                <ext:Button Text="Button 4" Icon="FlagAg" runat="server" />
                                <ext:Button Text="Button 5" Icon="FlagAi" runat="server" />
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                </ext:Panel>
            </Items>
        </ext:Viewport>
    </body>
    </html>
    Last edited by RCN; Feb 16, 2015 at 5:13 PM.
  10. #10
    I think it is a good fix for such kind of scenarios. Thank you for sharing!

    fixes all known cases
    I beg to differ. There are many cases there a Toolbar is not used at all. It is a more common problem with Menus.

    I think we will leave the things as it is for now. But if anyone encounters an issue like yours, we will point to your fix. Thanks!
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Disable overflow for some ToolBar's items
    By RCN in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 30, 2013, 2:22 PM
  2. Display error of Toolbar Overflow
    By howardyin in forum 2.x Help
    Replies: 8
    Last Post: Jan 11, 2013, 1:04 AM
  3. Replies: 10
    Last Post: Nov 09, 2011, 6:19 PM
  4. [CLOSED] Toolbar overflow icons
    By paulc in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 28, 2011, 2:09 PM
  5. [CLOSED] [1.0] Toolbar Overflow
    By Ben in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 12, 2010, 3:02 PM

Posting Permissions