Package com.vaadin.ui

Enum Grid.LayoutAfterScrollMode

  • All Implemented Interfaces:
    Serializable, Comparable<Grid.LayoutAfterScrollMode>
    Enclosing class:
    Grid<T>

    public static enum Grid.LayoutAfterScrollMode
    extends Enum<Grid.LayoutAfterScrollMode>
    Operation mode for re-layouting the Grid after a scroll event when Component Renderers are used.

    Some components can suffer layout corruption after scrolling, which is mitigated by running a full layout cycle on the Grid after a scroll event. Versions prior to 8.32.0 would always run a full layout cycle after every scroll if any component renderer was used. This becomes very performance-intensive in complex Grids.

    This enum allows using the previous behavior ("ALWAYS"), disabling the behavior when the fix is not needed and thus gain performance ("NEVER"), and setting it to the new default ("AUTOMATIC"), which uses a whitelist for Vaadin components that do not require a layout pass.

    Since:
    8.32
    • Enum Constant Detail

      • AUTOMATIC

        public static final Grid.LayoutAfterScrollMode AUTOMATIC
        Disable the layout after scroll if only Components that are known to not break layout are used. This is the default as of 8.32.0.
      • ALWAYS

        public static final Grid.LayoutAfterScrollMode ALWAYS
        Enable the layout after scroll mode if Component renderers are present. This is the behavior of Vaadin versions 8.25.0 through 8.31.1.
      • NEVER

        public static final Grid.LayoutAfterScrollMode NEVER
        Disable the layout after scroll mode. Use this only if you know for certain that your layout will not break on scroll. This can help speed up scrolling of complex Grids.
    • Method Detail

      • values

        public static Grid.LayoutAfterScrollMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Grid.LayoutAfterScrollMode c : Grid.LayoutAfterScrollMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Grid.LayoutAfterScrollMode valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null