v7.3.0

SubGrid

A SubGrid is a part of the grid (it has at least one and normally no more than two, called locked and normal). It has its own header, which holds the columns to display rows for in the SubGrid. SubGrids are created by Grid, but you can configure your SubGrids with the subGridConfigs object.

const grid = new Grid({
    appendTo : 'container',

features : { regionResize : true },

subGridConfigs : { locked : { width : 360 }, normal : { flex : 1 } } });

If you use multiple regions in your grid, you can enable the RegionResize feature to let users resize and collapse/expand grid sections.

If not configured with a width or flex, the SubGrid will be sized to fit its columns. In this case, if all columns have a fixed width (not using flex) then toggling columns will also affect the width of the SubGrid.

Useful configs

Config Description
region Name of this SubGrid section (e.g. 'locked')
columns Column store for this SubGrid
collapsed Collapse this SubGrid section
flex Flex value for the SubGrid width

See also

  • Grid - The grid that owns SubGrid sections
  • subGridConfigs - Configure SubGrids from the grid
  • RegionResize - Feature to resize/collapse SubGrid sections
No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isSubGrid : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of SubGrid class, or subclass thereof.

Functions

Functions are methods available for calling on the class
    • clearRows( )
      private

      Removes all row elements from the subgrids body and empties cache

    • fixWidths( )
      private

      Sets header width and scroller width (if needed, depending on if using flex). Might also change the subgrids width, if it uses a width calculated from its columns.

    • Triggers the 'horizontalScroll' event + makes sure overlay scrollbar is reachable with pointer for a substantial amount of time after scrolling starts

    • initScroll( )
      private

      Init scroll syncing for header and footer (if available).

    • onAddRow( )
      private

      Creates elements for the new rows when RowManager has determined that more rows are needed

    • onInternalResize( )
      private

      Called when grid changes size. SubGrid determines if it has changed size and triggers scroll (for virtual rendering in cells to work when resizing etc.)

    • refreshFakeScroll( )
      private

      Fixes widths of fake scrollers

    • Resize all columns in the SubGrid to fit their width, according to their configured fitMode

    • Keeps the parallel splitters in the header, footer and fake scroller synced in terms of being collapsed or not.

    • updateHasFlex( )
      internal

      Called when updating column widths to apply 'b-has-flex' which is used when fillLastColumn is configured.

    Events

    Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

    Event handlers

    Event handlers are callbacks called as a result of certain actions in this class

    Source path

    Grid/view/SubGrid.js

    Contents