Sencha GXT3 : Horizontal Layout Container with Scrolling

114 Views Asked by At

I use in my application sencha GXT 3 (Version 3.1.0). I want to display many items (widgets) horizontally. For this, I use HboxLayoutContainer. I have 14 widgets to display. The first 10 widgets are displayed correctly. The 4 widgets remaning are not displayed and the container display a dropdown button (Overflow case). With this button I can't see those 4 items. Can you help me to resolve this problem ?

1

There are 1 best solutions below

0
Justin Hickman On

The HBoxLayoutContainer is very specific on what is available in the overflow menu. It needs to know how to convert each item into a MenuItem. It'll have to be renderable and handle the appropriate select/click events.

What this means is that not every Widget added in the HBoxLayoutContainer is going to be compatible as an overflow MenuItem. For example, you wouldn't be able to (easily) convert a Grid into a single MenuItem; at least not in an abstract "widget library" way.

If you open up HBoxLayoutContainer and inspect the addWidgetToMenu, you'll get a better sense of which types are supported by default. From my copy (4.0.0 - but probably not too different from 3.x), I see:

  • SeparatorToolItem
  • SplitButton
  • TextButton
  • ButtonGroup
  • ToggleButton

All of which are GXT components.

Not all is lost though. Since the method is protected, it should be fairly straightforward to subclass and override this method to handle any Widget of your choice.