Class VGrid<T>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.Grid<T>
org.vaadin.firitin.components.grid.VGrid<T>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.grid.Grid<T>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<com.vaadin.flow.component.grid.Grid<T>>, com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.grid.Grid<T>>, 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<com.vaadin.flow.component.grid.Grid<T>,com.vaadin.flow.component.grid.GridSortOrder<T>>, com.vaadin.flow.data.provider.HasDataGenerators<T>, com.vaadin.flow.data.provider.HasDataView<T,Void,com.vaadin.flow.component.grid.dataview.GridDataView<T>>, com.vaadin.flow.data.provider.HasLazyDataView<T,Void,com.vaadin.flow.component.grid.dataview.GridLazyDataView<T>>, com.vaadin.flow.data.provider.HasListDataView<T,com.vaadin.flow.component.grid.dataview.GridListDataView<T>>, Serializable, FluentAttachNotifier<VGrid<T>>, FluentBlurNotifier<com.vaadin.flow.component.grid.Grid<T>,VGrid<T>>, FluentComponent<VGrid<T>>, FluentDetachNotifier<VGrid<T>>, FluentFocusable<com.vaadin.flow.component.grid.Grid<T>,VGrid<T>>, FluentFocusNotifier<com.vaadin.flow.component.grid.Grid<T>,VGrid<T>>, FluentHasSize<VGrid<T>>, FluentHasStyle<VGrid<T>>, FluentHasTheme<VGrid<T>>
Direct Known Subclasses:
PagingGrid, TreeTable

public class VGrid<T> extends com.vaadin.flow.component.grid.Grid<T> implements FluentComponent<VGrid<T>>, FluentHasStyle<VGrid<T>>, FluentHasSize<VGrid<T>>, FluentFocusable<com.vaadin.flow.component.grid.Grid<T>,VGrid<T>>, FluentHasTheme<VGrid<T>>
See Also:
  • Nested Class Summary Link icon

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    An interface to configure formatting of all data cells in the Grid.
    static interface 
    Used to assign Style rules to row cells.
    static class 
     

    Nested classes/interfaces inherited from class com.vaadin.flow.component.grid.Grid Link icon

    com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T>, com.vaadin.flow.component.grid.Grid.Column<T>, com.vaadin.flow.component.grid.Grid.DataCommunicatorBuilder<T,U extends com.vaadin.flow.data.provider.ArrayUpdater>, com.vaadin.flow.component.grid.Grid.MultiSortPriority, com.vaadin.flow.component.grid.Grid.NestedNullBehavior, com.vaadin.flow.component.grid.Grid.SelectionMode, com.vaadin.flow.component.grid.Grid.UpdateQueue

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier Link icon

    com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier Link icon

    com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
     
    VGrid(int pageSize)
     
    VGrid(Class<T> beanType)
     
    VGrid(Class<T> beanType, boolean autoCreateColumns)
    Creates a new Grid with given bean type.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    protected <C extends com.vaadin.flow.component.grid.Grid.Column<T>>
    C
    addColumn(com.vaadin.flow.function.ValueProvider<T,?> valueProvider, BiFunction<com.vaadin.flow.data.renderer.Renderer<T>,String,C> columnFactory)
     
    com.vaadin.flow.component.grid.Grid.Column<T>
    addColumn(String propertyName)
     
    protected BiFunction<com.vaadin.flow.data.renderer.Renderer<T>,String,com.vaadin.flow.component.grid.Grid.Column<T>>
     
    hideProperties(String... propertyNamesToHide)
    Hides given columns.
    void
    Deprecated.
    Note, with lazy loaded content, calling this method may cause performance issues
    void
    setColumns(String... propertyNames)
     
    setDataProvider(com.vaadin.flow.data.provider.CallbackDataProvider.FetchCallback<T,Void> fetchCallback, com.vaadin.flow.data.provider.CallbackDataProvider.CountCallback<T,Void> countCallback)
     
    Defines a formatter used for all basic data columns.
    Adds a Vaadin 3,4,5,6,7,8 style column selector.
     
    withItems(T... items)
     
    withProperties(String... propertyNames)
     
    Adds a strategy to style cells based on rows.
    withSelectionMode(com.vaadin.flow.component.grid.Grid.SelectionMode selectionMode)
     
    withSelectionModel(com.vaadin.flow.component.grid.GridSelectionModel<T> selectionModel, com.vaadin.flow.component.grid.Grid.SelectionMode selectionMode)
     
    withThemeVariants(com.vaadin.flow.component.grid.GridVariant... variants)
     

    Methods inherited from class com.vaadin.flow.component.grid.Grid Link icon

    addCellFocusListener, addColumn, addColumn, addColumn, addColumn, addColumn, addColumnReorderListener, addColumnResizeListener, addColumns, addComponentColumn, addContextMenu, addDataGenerator, addDragEndListener, addDragStartListener, addDropListener, addFirstHeaderRow, addItemClickListener, addItemDoubleClickListener, addSelectionListener, addSortListener, addThemeVariants, addValueProvider, appendFooterRow, appendHeaderRow, asMultiSelect, asSingleSelect, compareMaybeComparables, configureBeanType, createColumn, createColumnId, createDefaultArrayUpdater, createEditor, createSortingComparator, deselect, deselectAll, getArrayUpdater, getBeanType, getClassNameGenerator, getColumnByKey, getColumnLayers, getColumnRendering, getColumns, getDataCommunicator, getDataProvider, getDefaultHeaderRow, getDragFilter, getDropFilter, getDropMode, getEditor, getEmptyStateComponent, getEmptyStateText, getFooterRows, getGenericDataView, getHeaderRows, getLazyDataView, getListDataView, getNestedNullBehavior, getPageSize, getPartNameGenerator, getPropertySet, getSelectedItems, getSelectionMode, getSelectionModel, getSelectionPreservationMode, getSortOrder, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isAllRowsVisible, isColumnReorderingAllowed, isDetailsVisible, isDetailsVisibleOnClick, isMultiSort, isRowsDraggable, onAttach, onDataProviderChange, onDetach, onEnabledStateChanged, prependFooterRow, prependHeaderRow, recalculateColumnWidths, removeAllColumns, removeAllFooterRows, removeAllHeaderRows, removeColumn, removeColumnByKey, removeColumnLayer, removeColumns, removeFooterRow, removeHeaderRow, removeThemeVariants, scrollToEnd, scrollToIndex, scrollToStart, select, setAllRowsVisible, setClassNameGenerator, setColumnKey, setColumnOrder, setColumnOrder, setColumnRendering, setColumnReorderingAllowed, setDataProvider, setDefaultMultiSortPriority, setDetailsVisible, setDetailsVisibleOnClick, setDragDataGenerator, setDragFilter, setDropFilter, setDropMode, setEmptyStateComponent, setEmptyStateText, setItemDetailsRenderer, setItems, setItems, setItems, setItems, setMultiSort, setMultiSort, setMultiSort, setMultiSort, setNestedNullBehavior, setPageSize, setPartNameGenerator, setRowsDraggable, setSelectionDragDetails, setSelectionMode, setSelectionModel, setSelectionPreservationMode, setSortableColumns, setTooltipGenerator, setUniqueKeyProperty, setUniqueKeyProvider, sort, updateSelectionModeOnClient

    Methods inherited from class com.vaadin.flow.component.Component Link icon

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier Link icon

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.BlurNotifier Link icon

    addBlurListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier Link icon

    addDetachListener

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentAttachNotifier Link icon

    withAttachListener

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentBlurNotifier Link icon

    withBlurListener

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentComponent Link icon

    setId, setVisible, withId, withVisible

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentDetachNotifier Link icon

    withDetachListener

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentFocusable Link icon

    withTabIndex

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentFocusNotifier Link icon

    withFocusListener

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentHasStyle Link icon

    withAddedClassName, withClassName, withStyle

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentHasTheme Link icon

    withThemeNames

    Methods inherited from interface com.vaadin.flow.component.Focusable Link icon

    addFocusShortcut, blur, focus, getTabIndex, setTabIndex

    Methods inherited from interface com.vaadin.flow.component.FocusNotifier Link icon

    addFocusListener

    Methods inherited from interface com.vaadin.flow.component.HasElement Link icon

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled Link icon

    isEnabled, setEnabled

    Methods inherited from interface com.vaadin.flow.data.provider.HasLazyDataView Link icon

    setItems, setItems

    Methods inherited from interface com.vaadin.flow.data.provider.HasListDataView Link icon

    setItems, setItems

    Methods inherited from interface com.vaadin.flow.component.HasSize Link icon

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle Link icon

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.HasTheme Link icon

    addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
  • Constructor Details Link icon

    • VGrid Link icon

      public VGrid()
    • VGrid Link icon

      public VGrid(int pageSize)
    • VGrid Link icon

      public VGrid(Class<T> beanType)
    • VGrid Link icon

      public VGrid(Class<T> beanType, boolean autoCreateColumns)
      Creates a new Grid with given bean type.
      Parameters:
      beanType - the bean/record type
      autoCreateColumns - if true, columns are created automatically for all introspected properties
  • Method Details Link icon

    • getDefaultColumnFactory Link icon

      protected BiFunction<com.vaadin.flow.data.renderer.Renderer<T>,String,com.vaadin.flow.component.grid.Grid.Column<T>> getDefaultColumnFactory()
      Overrides:
      getDefaultColumnFactory in class com.vaadin.flow.component.grid.Grid<T>
    • withSelectionMode Link icon

      public VGrid<T> withSelectionMode(com.vaadin.flow.component.grid.Grid.SelectionMode selectionMode)
    • withSelectionModel Link icon

      public VGrid<T> withSelectionModel(com.vaadin.flow.component.grid.GridSelectionModel<T> selectionModel, com.vaadin.flow.component.grid.Grid.SelectionMode selectionMode)
    • withProperties Link icon

      public VGrid<T> withProperties(String... propertyNames)
    • hideProperties Link icon

      public VGrid<T> hideProperties(String... propertyNamesToHide)
      Hides given columns.
      Parameters:
      propertyNamesToHide - the property names/column keys to hide
      Returns:
      the grid for further configuration
    • setColumns Link icon

      public void setColumns(String... propertyNames)
      Overrides:
      setColumns in class com.vaadin.flow.component.grid.Grid<T>
    • addColumn Link icon

      public com.vaadin.flow.component.grid.Grid.Column<T> addColumn(String propertyName)
      Overrides:
      addColumn in class com.vaadin.flow.component.grid.Grid<T>
    • withThemeVariants Link icon

      public VGrid<T> withThemeVariants(com.vaadin.flow.component.grid.GridVariant... variants)
    • setDataProvider Link icon

      public VGrid<T> setDataProvider(com.vaadin.flow.data.provider.CallbackDataProvider.FetchCallback<T,Void> fetchCallback, com.vaadin.flow.data.provider.CallbackDataProvider.CountCallback<T,Void> countCallback)
    • withItems Link icon

      public VGrid<T> withItems(Collection<T> items)
    • withItems Link icon

      public VGrid<T> withItems(T... items)
    • scrollToItem Link icon

      @Deprecated public void scrollToItem(T item)
      Deprecated.
      Note, with lazy loaded content, calling this method may cause performance issues
      Scrolls to the row presenting the given item.
      Overrides:
      scrollToItem in class com.vaadin.flow.component.grid.Grid<T>
      Parameters:
      item - the item to scroll to
    • withColumnSelector Link icon

      public VGrid<T> withColumnSelector()
      Adds a Vaadin 3,4,5,6,7,8 style column selector.
      Returns:
      the grid with column selector
    • addColumn Link icon

      protected <C extends com.vaadin.flow.component.grid.Grid.Column<T>> C addColumn(com.vaadin.flow.function.ValueProvider<T,?> valueProvider, BiFunction<com.vaadin.flow.data.renderer.Renderer<T>,String,C> columnFactory)
      Overrides:
      addColumn in class com.vaadin.flow.component.grid.Grid<T>
    • withCellFormatter Link icon

      public VGrid<T> withCellFormatter(VGrid.CellFormatter<T> formatter)
      Defines a formatter used for all basic data columns.
      Parameters:
      formatter - the formatter
      Returns:
      the VGrid for further configuration
    • withRowStyler Link icon

      public VGrid<T> withRowStyler(VGrid.RowStyler<T> rowStyler)
      Adds a strategy to style cells based on rows.
      Parameters:
      rowStyler - the RowStyler