Class GridPro<E>

  • All Implemented Interfaces:
    com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<Grid<E>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<Grid<E>>, com.vaadin.flow.component.FocusNotifier<Grid<E>>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.data.event.SortEvent.SortNotifier<Grid<E>,​GridSortOrder<E>>, com.vaadin.flow.data.provider.HasDataGenerators<E>, com.vaadin.flow.data.provider.HasDataView<E,​Void,​GridDataView<E>>, com.vaadin.flow.data.provider.HasLazyDataView<E,​Void,​GridLazyDataView<E>>, com.vaadin.flow.data.provider.HasListDataView<E,​GridListDataView<E>>, Serializable

    @Tag("vaadin-grid-pro")
    @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="23.3.5") @NpmPackage(value="@vaadin/grid-pro",version="23.3.5") @NpmPackage(value="@vaadin/vaadin-grid-pro",version="23.3.5")
    @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/grid-pro/src/vaadin-grid-pro.js") @JsModule("@vaadin/grid-pro/src/vaadin-grid-pro-edit-column.js") @JsModule("./gridProConnector.js")
    public class GridPro<E>
    extends Grid<E>
    See Also:
    Serialized Form
    • Constructor Detail

      • GridPro

        public GridPro​(Class<E> beanType)
        Instantiates a new CrudGrid for the supplied bean type.
        Parameters:
        beanType - the beanType for the item
      • GridPro

        public GridPro()
        Creates a new instance, with page size of 50.
      • GridPro

        public GridPro​(int pageSize)
        Creates a new instance, with the specified page size.

        The page size influences the Query.getLimit() sent by the client, but it's up to the webcomponent to determine the actual query limit, based on the height of the component and scroll position. Usually the limit is 3 times the page size (e.g. 150 items with a page size of 50).

        Parameters:
        pageSize - the page size. Must be greater than zero.
    • Method Detail

      • onEnabledStateChanged

        public void onEnabledStateChanged​(boolean enabled)
        Overrides:
        onEnabledStateChanged in class Grid<E>
      • setEnterNextRow

        public void setEnterNextRow​(boolean enterNextRow)
        Sets the value of the webcomponent's property enterNextRow. Default values is false. When true, pressing Enter while in cell edit mode will move focus to the editable cell in the next row (Shift + Enter - same, but for previous row).
        Parameters:
        enterNextRow - when true, pressing Enter while in cell edit mode will move focus to the editable cell in the next row (Shift + Enter - same, but for previous row)
      • getEnterNextRow

        @Synchronize("enter-next-row-changed")
        public boolean getEnterNextRow()
        Gets the value of the webcomponent's property enterNextRow. Default values is false. When true, pressing Enter while in cell edit mode will move focus to the editable cell in the next row (Shift + Enter - same, but for previous row).
        Returns:
        enterNextRow value
      • setSingleCellEdit

        public void setSingleCellEdit​(boolean singleCellEdit)
        Sets the value of the webcomponent's property singleCellEdit. Default values is false. When true, after moving to next or previous editable cell using Tab / Shift+Tab, it will be focused without edit mode.
        Parameters:
        singleCellEdit - when true, after moving to next or previous editable cell using Tab / Shift+Tab, it will be focused without edit mode
      • getSingleCellEdit

        @Synchronize("single-cell-edit-changed")
        public boolean getSingleCellEdit()
        Gets the value of the webcomponent's property singleCellEdit. Default values is false. When true, after moving to next or previous editable cell using Tab / Shift+Tab, it will be focused without edit mode.
        Returns:
        singleCellEdit value
      • setEditOnClick

        public void setEditOnClick​(boolean editOnClick)
        Sets the value of the webcomponent's property editOnClick. Default values is false. When true, cell edit mode gets activated on a single click instead of the default double click.
        Parameters:
        editOnClick - when true, cell edit mode gets activated on a single click instead of the default double click
      • getEditOnClick

        @Synchronize("edit-on-click-changed")
        public boolean getEditOnClick()
        Gets the value of the webcomponent's property editOnClick. Default values is false. When true, cell edit mode gets activated on a single click instead of the default double click.
        Returns:
        editOnClick value
      • createEditColumn

        protected GridPro.EditColumn<E> createEditColumn​(com.vaadin.flow.data.renderer.Renderer<E> renderer,
                                                         String columnId)
        Creates a new edit column instance for this GridPro instance.

        This method must not return null.

        Parameters:
        renderer - the renderer used to create the grid cell structure
        columnId - internal column id
        Returns:
        edit column instance
        See Also:
        Renderer
      • addCellEditStartedListener

        public com.vaadin.flow.shared.Registration addCellEditStartedListener​(com.vaadin.flow.component.ComponentEventListener<GridPro.CellEditStartedEvent<E>> listener)
        Registers a listener to be notified when the user starts to edit an existing item.
        Parameters:
        listener - a listener to be notified
        Returns:
        a handle that can be used to unregister the listener
      • addItemPropertyChangedListener

        public com.vaadin.flow.shared.Registration addItemPropertyChangedListener​(com.vaadin.flow.component.ComponentEventListener<GridPro.ItemPropertyChangedEvent<E>> listener)
        Registers a listener to be notified when the user has edited an existing item.
        Parameters:
        listener - a listener to be notified
        Returns:
        a handle that can be used to unregister the listener
      • addThemeVariants

        public void addThemeVariants​(GridProVariant... variants)
        Adds theme variants to the component.
        Parameters:
        variants - theme variants to add
      • removeThemeVariants

        public void removeThemeVariants​(GridProVariant... variants)
        Removes theme variants from the component.
        Parameters:
        variants - theme variants to remove