GridBase

A thin base class for Grid. Does not include any features by default, allowing smaller custom-built bundles if used in place of Grid.

NOTE: In most scenarios you probably want to use Grid instead of GridBase.

Configs

157

Common

Accepts column definitions for the grid during initialization. They will be used to create Column instances that are added to a ColumnStore.

At runtime it returns the ColumnStore.

Initialization using column config objects:

new Grid({
  columns : [
    { text : 'Alias', field : 'alias' },
    { text : 'Superpower', field : 'power' }
  ]
});

Also accepts a store config object:

new Grid({
  columns : {
    data : [
      { text : 'Alias', field : 'alias' },
      { text : 'Superpower', field : 'power' }
    ],
    listeners : {
      update() {
        // Some update happened
      }
    }
  }
});

Access the ColumnStore at runtime to manipulate columns:

grid.columns.add({ field : 'column', text : 'New column' });

Replacing the columns fully at runtime:

grid.columns = [{ field : 'column', text : 'New column' }];

Convenient shortcut to set data in grids store both during initialization and at runtime. Can also be used to retrieve data at runtime, although we do recommend interacting with Grids store instead using the store property.

Setting initial data during initialization:

const grid = new Grid({
    data : [
      { id : 1, name : 'Batman' },
      { id : 2, name : 'Robin' },
      ...
    ]
});

Setting data at runtime:

grid.data = [
    { id : 3, name : 'Joker' },
    ...
];

Getting data at runtime:

const records = store.data;

Note that a Store will be created during initialization if none is specified.

Text or HTML, or a EmptyTextDomConfig block to display when there is no data to display in the grid. When using multiple Grid regions, provide the region property to decide where the text is shown. By default, it is shown in the first region.

new Grid({
    emptyText : {
        region : 'locked',
        text   : 'No data available'
    }
})
features: Object

An object containing Feature configuration objects (or true if no configuration is required) keyed by the Feature class name in all lowercase.

keyMap: Object<String, KeyMapConfig>

See Keyboard shortcuts for details

Preserve the grid's vertical scroll position when changesets are applied, as in the case of remote changes, or when stores are configured with syncDataOnLoad.

Row height in pixels. This allows the default height for rows to be controlled. Note that it may be overriden by specifying a rowHeight on a per record basis, or from a column renderer.

When initially configured as null, an empty row will be measured and its height will be used as default row height, enabling it to be controlled using CSS

Store that holds records to display in the grid, or a store config object. If the configuration contains a readUrl, an AjaxStore will be created.

Note that a store will be created during initialization if none is specified.

Supplying a store config object at initialization time:

const grid = new Grid({
    store : {
        fields : ['name', 'powers'],
        data   : [
            { id : 1, name : 'Aquaman', powers : 'Decent swimmer' },
            { id : 2, name : 'Flash', powers : 'Pretty fast' },
        ]
    }
});

Accessing the store at runtime:

grid.store.sort('powers');
listenersEvents

Layout

autoHeight: Boolean= false

Automatically set grids height to fit all rows (no scrolling in the grid). In general you should avoid using autoHeight: true, since it will bypass Grids virtual rendering and render all rows at once, which in a larger grid is really bad for performance.

fillLastColumn: Boolean= true

Set to true to stretch the last column in a grid with all fixed width columns to fill extra available space if the grid's width is wider than the sum of all configured column widths.

Use fixed row height. Setting this to true will configure the underlying RowManager to use fixed row height, which sacrifices the ability to use rows with variable height to gain a fraction better performance.

Using this setting also ignores the getRowHeight function, and thus any row height set in data. Only Grids configured rowHeight is used.

getRowHeight: function

A function called for each row to determine its height. It is passed a record and expected to return the desired height of that records row. If the function returns a falsy value, Grids configured rowHeight is used.

The default implementation of this function returns the row height from the records rowHeight field.

Override this function to take control over how row heights are determined:

new Grid({
   getRowHeight(record) {
       if (record.low) {
           return 20;
       }
       else if (record.high) {
           return 60;
       }

       // Will use grids configured rowHeight
       return null;
   }
});

NOTE: Height set in a Column renderer takes precedence over the height returned by this function.

ParameterTypeDescription
getRowHeight.recordModel

Record to determine row height for

Returns: Number -

Desired row height

minHeight: String | Number

Grid's min-height. Defaults to 10em to be sure that the Grid always has a height wherever it is inserted.

Can be either a String or a Number (which will have 'px' appended).

Note that reading the value will return the numeric value in pixels.

Set to false to only measure cell contents when double-clicking the edge between column headers.

alignSelfWidget
dockWidget
flexWidget
heightWidget
hiddenWidget
hideWhenEmptyContainer
layoutContainer
layoutStyleContainer
marginWidget
maxHeightWidget
maxWidthWidget
minWidthWidget
textAlignWidget
weightWidget
widthWidget

Misc

animateFilterRemovals: Boolean= falsedeprecated

Set to true to animate row removals caused by filtering.

animateRemovingRows: Booleandeprecated

Controls if removing and inserting rows should be animated. Set to false to prevent those animations, removing the related delays.

Set to false to crop text in grid cells without ellipsis (...). When enabled, cells containing pure use display : block, instead of display : flex to allow ellipsis to work. NOTE Only supported in browsers that support :has() CSS selector

Set to false to not show column lines. End result might be overruled by/differ between themes.

contextMenuTriggerEvent: contextmenu | click | dblclick= contextmenu

Event which is used to show context menus. Available options are: 'contextmenu', 'click', 'dblclick'.

defaultRegion: String= normal

Region to which columns are added when they have none specified

destroyStore: Boolean= false

Set to true to destroy the store when the grid is destroyed.

Set to true to not get a warning when using another base class than GridRowModel for your grid data. If you do, and would like to use the full feature set of the grid then include the fields from GridRowModel in your model definition.

enableSticky: Boolean

Configure this as true to allow elements within cells to be styled as position: sticky.

Columns which contain sticky content will need to be configured with

   cellCls : 'b-sticky-cell',

Or a custom renderer can add the class to the passed cell element.

It is up to the application author how to style the cell content. It is recommended that a custom renderer create content with CSS class names which the application author will use to apply the position, and matching margin-top and top styles to keep the content stuck at the grid's top.

Note that not all browsers support this CSS feature. A cross browser alternative is to use the {link Grid.feature.StickyCells StickyCells} Feature.

fullRowRefresh: Boolean= true

Refresh entire row when a record changes (true) or, if possible, only the cells affected (false).

When this is set to false, then if a column uses a renderer, cells in that column will still be updated because it is impossible to know whether the cells value will be affected.

If a standard, provided Column class is used with no custom renderer, its cells will only be updated if the column's field is changed.

Set to true to hide the footer elements

Set to true to hide the column header elements

hideHorizontalScrollbar: Boolean= false

Set to true to hide the Grid's horizontal scrollbar(s)

Grids change the maskDefaults to cover only their body element.

monitorResize: Boolean= true

Grid monitors window resize by default.

True to preserve focused cell after loading new data

Specify true to preserve vertical scroll position after store actions that trigger a refresh event, such as loading new data and filtering.

readOnly: Boolean= falseAlso a property

Set to true to make the grid read-only, by disabling any UIs for modifying data.

Note that checks MUST always also be applied at the server side.

Set to false to not show row lines. End result might be overruled by/differ between themes.

showDirty: Boolean | Object= false

Configure as true to have the grid show a red "changed" tag in cells whose field value has changed and not yet been committed.

Set showDirty.duringEdit to true to show the red tag while editing a cell

showDirty : {
    duringEdit : true
}

Set showDirty.newRecord to true to show the red tag for all the cells of the new record

showDirty : {
    newRecord : true
}
ParameterTypeDescription
showDirty.duringEditBoolean

Set to true to show the red tag while editing a cell

showDirty.newRecordBoolean

Set to true to show the red tag for all the cells of the new record

subGridConfigs: Object<String, SubGridConfig>

An object containing sub grid configuration objects keyed by a region property. By default, grid has a 'locked' region (if configured with locked columns) and a 'normal' region. The 'normal' region defaults to use flex: 1.

This config can be used to reconfigure the "built-in" sub grids or to define your own.

Redefining the default regions:

new Grid({
  subGridConfigs : {
    locked : { flex : 1 },
    normal : { width : 100 }
  }
});

Defining your own multi region grid:

new Grid({
  subGridConfigs : {
    left   : { width : 100 },
    middle : { flex : 1 },
    right  : { width  : 100 }
  },

  columns : [
    { field : 'manufacturer', text: 'Manufacturer', region : 'left' },
    { field : 'model', text: 'Model', region : 'middle' },
    { field : 'year', text: 'Year', region : 'middle' },
    { field : 'sales', text: 'Sales', region : 'right' }
  ]
});

Animation transition duration in milliseconds.

dataFieldWidget
disabledWidget
enableUndoRedoKeysGridElementEvents
hoverClsGridElementEvents
iconPanel
localeClassLocalizable
localizableLocalizable
longPressTimeGridElementEvents
maskedWidget
ownerWidget
pluginsPluggable
refWidget
responsiveLevelsGridResponsive
rippleWidget
tabWidget
titlePanel
tooltipWidget

Other

An object which names formula prefixes which will be applied to all columns configured with formula : true.

Each entry is keyed by a formula prefix, and each value is how to instantiate and configure a FormulaProvider when that prefix is used in the typed vale, eg: =XXX(

If the configured value contains a type property, that is used to determine a registered formula provider subclass to instantiate.

fields : [{
    name             : 'review',
    formulaProviders : {
       AI : {
         type : 'remote',
         url  : 'https://my-ai-service.com'
       },
       SUM : {
          type : 'sum'
       }
    }
}]

Formula providers may be added to dynamically:

// Enable registered MYFormula class to be used as a formula provider in the Grid
grid.store.modelClass.fieldMap.review.formulaProviders.MY = { ... };

Configure UI transitions for various actions in the grid.

ParameterTypeDescription
insertRecordBoolean

Transition record insertions

removeRecordBoolean

Transition record removals

toggleColumnBoolean

Transition column visibility changes

expandCollapseColumnBoolean

Transition parent/group column expand/collapse

toggleRegionBoolean

Transition region expand/collapse

toggleTreeNodeBoolean

Transition tree node expand/collapse

toggleGroupBoolean

Transition group expand/collapse

filterRemovalBoolean

Transition row removals caused by filtering (under specific conditions)

columnWidget
defaultFocusContainer
drawerPanel
labelPositionContainer
renditionContainer
rtlRTL
spanWidget
stateSettingsGridState

Scrolling

Configures whether the grid is scrollable in the Y axis. This is used to configure a Scroller. See the scrollerClass config option.

By default the grid is scrollable in the Y axis. If your platform shows scrollbars, they will appear when the content of the grid overflows.

To always show a scrollbar - even an empty one when there is no overflow - configure this as:

   scrollable : {
       overflowY : 'scroll'
   }

The class to instantiate to use as the scrollable. Defaults to Scroller.

Configuration values for the ScrollManager class on initialization. Returns the ScrollManager at runtime.

Selection

enableTextSelection: Boolean= false

Set to true to allow text selection in the grid cells. Note, this cannot be used simultaneously with the RowReorder feature.

selectionModeGridSelection

State

Set to true to not get a warning when calling getState when there is a column configured without an id. But the recommended action is to always configure columns with an id when using states.

stateIdState

Tree

animateTreeNodeToggle: Boolean= truedeprecatedAlso a property

When the Tree feature is in use and the Store is a tree store, this config may be set to true to visually animate branch node expand and collapse operations.

This is not supported in Scheduler and Gantt

Accessibility

ariaLabelWidget

Content

bbarPanel
defaultsContainer
footerPanel
headerPanel
itemsContainer
lazyItemsContainer
namedItemsContainer
stripsPanel
tbarPanel
textContentContainer
toolsPanel

CSS

bodyClsPanel
borderContainer
clsWidget
colorWidget
htmlClsWidget
itemClsContainer
styleWidget
uiPanel

DOM

adoptWidget
appendToWidget
contentWidget
datasetWidget
htmlWidget
idWidget
tagWidget

Float & align

alignWidget
anchorWidget
centeredWidget
draggableWidget
floatingWidget
xWidget
yWidget

Masking

loadMaskLoadMaskable
loadMaskDefaultsLoadMaskable
loadMaskErrorLoadMaskable
syncMaskLoadMaskable

misc

tabBarItemsContainer

Record

recordContainer

Properties

137

Common

Accepts column definitions for the grid during initialization. They will be used to create Column instances that are added to a ColumnStore.

At runtime it returns the ColumnStore.

Initialization using column config objects:

new Grid({
  columns : [
    { text : 'Alias', field : 'alias' },
    { text : 'Superpower', field : 'power' }
  ]
});

Also accepts a store config object:

new Grid({
  columns : {
    data : [
      { text : 'Alias', field : 'alias' },
      { text : 'Superpower', field : 'power' }
    ],
    listeners : {
      update() {
        // Some update happened
      }
    }
  }
});

Access the ColumnStore at runtime to manipulate columns:

grid.columns.add({ field : 'column', text : 'New column' });

Replacing the columns fully at runtime:

grid.columns = [{ field : 'column', text : 'New column' }];

Convenient shortcut to set data in grids store both during initialization and at runtime. Can also be used to retrieve data at runtime, although we do recommend interacting with Grids store instead using the store property.

Setting initial data during initialization:

const grid = new Grid({
    data : [
      { id : 1, name : 'Batman' },
      { id : 2, name : 'Robin' },
      ...
    ]
});

Setting data at runtime:

grid.data = [
    { id : 3, name : 'Joker' },
    ...
];

Getting data at runtime:

const records = store.data;

Note that a Store will be created during initialization if none is specified.

Text or HTML, or a EmptyTextDomConfig block to display when there is no data to display in the grid. When using multiple Grid regions, provide the region property to decide where the text is shown. By default, it is shown in the first region.

new Grid({
    emptyText : {
        region : 'locked',
        text   : 'No data available'
    }
})

Preserve the grid's vertical scroll position when changesets are applied, as in the case of remote changes, or when stores are configured with syncDataOnLoad.

Row height in pixels. This allows the default height for rows to be controlled. Note that it may be overriden by specifying a rowHeight on a per record basis, or from a column renderer.

When initially configured as null, an empty row will be measured and its height will be used as default row height, enabling it to be controlled using CSS

Store that holds records to display in the grid, or a store config object. If the configuration contains a readUrl, an AjaxStore will be created.

Note that a store will be created during initialization if none is specified.

Supplying a store config object at initialization time:

const grid = new Grid({
    store : {
        fields : ['name', 'powers'],
        data   : [
            { id : 1, name : 'Aquaman', powers : 'Decent swimmer' },
            { id : 2, name : 'Flash', powers : 'Pretty fast' },
        ]
    }
});

Accessing the store at runtime:

grid.store.sort('powers');
featuresGridFeatures
subGridsGridSubGrids

Class hierarchy

isGridBase: Boolean= truereadonly
Identifies an object as an instance of GridBase class, or subclass thereof.
isGridBase: Boolean= truereadonlystatic
Identifies an object as an instance of GridBase class, or subclass thereof.
isContainerContainer
isDelayableDelayable
isEventsEvents
isGridElementEventsGridElementEvents
isGridFeaturesGridFeatures
isGridResponsiveGridResponsive
isGridSelectionGridSelection
isGridStateGridState
isGridSubGridsGridSubGrids
isKeyMapKeyMap
isLoadMaskableLoadMaskable
isLocalizableLocalizable
isPanelPanel
isPluggablePluggable
isStateState
isToolableToolable
isWidgetWidget

Layout

bodyHeight: Numberreadonly

Body height

footerHeight: Numberreadonly

Footer height

headerHeight: Numberreadonly

Header height

alignSelfWidget
flexWidget
heightWidget
layoutContainer
layoutStyleContainer
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
widthWidget

Misc

Set to false to crop text in grid cells without ellipsis (...). When enabled, cells containing pure use display : block, instead of display : flex to allow ellipsis to work. NOTE Only supported in browsers that support :has() CSS selector

Set to false to not show column lines. End result might be overruled by/differ between themes.

Set to true to hide the footer elements

hideHeaders: Boolean= falseAlso a config

Set to true to hide the column header elements

readOnly: Boolean= falseAlso a config

Set to true to make the grid read-only, by disabling any UIs for modifying data.

Note that checks MUST always also be applied at the server side.

rowLines: Boolean= trueAlso a config

Set to false to not show row lines. End result might be overruled by/differ between themes.

Animation transition duration in milliseconds.

cellInfoWidget
disabledWidget
enableUndoRedoKeysGridElementEvents
hoveredCellGridElementEvents
localeHelperLocalizable
localeManagerLocalizable
longPressTimeGridElementEvents
pluginsPluggable
refWidget
responsiveLevelGridResponsive
tabWidget
titlePanel
tooltipWidget

Other

Configure UI transitions for various actions in the grid.

ParameterTypeDescription
insertRecordBoolean

Transition record insertions

removeRecordBoolean

Transition record removals

toggleColumnBoolean

Transition column visibility changes

expandCollapseColumnBoolean

Transition parent/group column expand/collapse

toggleRegionBoolean

Transition region expand/collapse

toggleTreeNodeBoolean

Transition tree node expand/collapse

toggleGroupBoolean

Transition group expand/collapse

filterRemovalBoolean

Transition row removals caused by filtering (under specific conditions)

$namestaticWidget
columnWidget
firstItemContainer
hasChangesContainer
isValidContainer
itemsContainer
labelPositionContainer
lastItemContainer
renditionContainer
rtlRTL
spanWidget
stateSettingsGridState
toolsPanel
typestaticWidget
valuesContainer

Rows

Get the topmost visible grid row

Get the last visible grid row

Scrolling

Configuration values for the ScrollManager class on initialization. Returns the ScrollManager at runtime.

Tree

animateTreeNodeToggle: Boolean= truedeprecatedAlso a config

When the Tree feature is in use and the Store is a tree store, this config may be set to true to visually animate branch node expand and collapse operations.

This is not supported in Scheduler and Gantt

Accessibility

keyMapKeyMap

Content

bbarPanel
tbarPanel

CSS

clsWidget

DOM

appendToWidget
contentWidget
datasetWidget
elementWidget
htmlWidget
idWidget
styleWidget

Float & align

xWidget
yWidget

Lifecycle

configBase

Record

recordContainer

Selection

selectedCellGridSelection
selectedCellsGridSelection
selectedRecordGridSelection
selectedRecordsGridSelection
selectedRowsGridSelection
selectionModeGridSelection

State

stateGridState

Visibility

hiddenWidget
isVisibleWidget

Widget hierarchy

ownerWidget
parentWidget
widgetMapContainer

Functions

124

Getters

Returns a cell if rendered or null if not found.

ParameterTypeDescription
cellContextGridLocationConfig

A cell location descriptor

Returns: HTMLElement | null

Searches up from specified element for a grid cell or a header and returns the column which the cell belongs to

ParameterTypeDescription
elementHTMLElement

Element somewhere in a cell

Returns: Column -

Column to which the cell belongs

Returns the footer element for the column (only relevant when using the Summary feature)

ParameterTypeDescription
columnIdString | Number | Column

or Column instance

Returns: HTMLElement -

Header element

Returns the header element for the column

ParameterTypeDescription
columnIdString | Number | Column

or Column instance

Returns: HTMLElement -

Header element

Searches up from the specified element for a grid row and returns the record associated with that row.

ParameterTypeDescription
elementHTMLElement

Element somewhere within a row or the row container element

Returns: Model -

Record for the row

Misc

Highlights the specified cells. If scroll is set to true (which it is by default), the highlighted cell closest to the viewport center will be scrolled into view.

By default, the highlighting will fade out non-highlighted cells. Use the mode option to change the highlight style to apply a background color to the highlighted cells instead.

// Highlight single cell (default fade mode)
grid.highlightCells({ cells : { id : 1, field : 'name' } });
// Highlight with background color
grid.highlightCells({ cells : { id : 1, field : 'name' }, mode : 'color' });
// Highlight multiple cells
grid.highlightCells({ cells : [{ id : 1, field : 'name' }, { id : 2, field : 'age' }] });
// Don't scroll to highlighted cell, and don't un-highlight on click
grid.highlightCells({ cells : { id : 1, field : 'name' }, scroll : false, unhighlightOnClick : false });
// Auto-unhighlight after 2 seconds
grid.highlightCells({ cells : { id : 1, field : 'name' }, unhighlightAfter : 2000 });

Cell highlighting
//<code-header>
fiddle.title = 'Cell highlighting';
//</code-header>
const grid = new Grid({
    appendTo   : targetElement,
    autoHeight : true,
    data       : DataGenerator.generateData(5),
    columns    : [
        { field : 'name', text : 'Name', flex : 1 },
        { field : 'city', text : 'City', width : 150 },
        { type : 'number', field : 'age', text : 'Age', width : 100 },
        { field : 'food', text : 'Food', width : 150 }
    ],
    tbar : [
        {
            text      : 'Highlight',
            rendition : 'outlined',
            onClick   : ({ source }) => {
                source.up('grid').highlightCells({
                    cells : [
                        { id : 1, field : 'city' },
                        { id : 5, field : 'food' }
                    ]
                });
            } },
        {
            text      : 'Highlight (color)',
            rendition : 'outlined',
            onClick   : ({ source }) => {
                source.up('grid').highlightCells({
                    cells : [
                        { id : 2, field : 'city' },
                        { id : 3, field : 'city' },
                        { id : 4, field : 'city' }
                    ],
                    mode : 'color' });
            } },
        {
            text      : 'Highlight (for 2s)',
            rendition : 'outlined',
            onClick   : ({ source }) => {
                source.up('grid').highlightCells({
                    cells : [
                        { id : 2, field : 'name' },
                        { id : 2, field : 'city' },
                        { id : 2, field : 'age' },
                        { id : 2, field : 'food' }
                    ],
                    unhighlightAfter : 2000
                });
            } }
    ]
});

ParameterTypeDescription
optionsObject

Options config object

options.cellsGridLocationConfig | GridLocationConfig[]

The cells to highlight. Each cell is specified as a GridLocationConfig object with id (or record) and columnId (or columnIndex or field).

options.modefade | color

The highlight mode:

  • 'fade' (default): Fades out non-highlighted cells by adding an overlay
  • 'color': Applies a background color to highlighted cells
options.scrollBoolean | BryntumScrollOptions

If false, no scrolling will be performed. If a scrollOptions object, this object will be passed to the scroll function providing details on how to scroll.

options.unhighlightOnClickBoolean

If false, a call to unhighlightCells is needed to remove the highlighting. Otherwise, the highlighting will be removed when the user clicks somewhere in the browser window.

options.unhighlightOthersBoolean

If true this will automatically un-highlight the cells not present in the cells property

options.unhighlightAfterNumber

If specified, the cells highlighted by this call will be automatically un-highlighted after the specified number of milliseconds. Cells highlighted by subsequent calls are not affected.

Show a load mask with a spinner and the specified message. When using an AjaxStore masking and unmasking is handled automatically, but if you are loading data in other ways you can call this function manually when your load starts.

myLoadFunction() {
  // Show mask before initiating loading
  grid.maskBody('Loading data');
  // Your custom loading code
  load.then(() => {
     // Hide the mask when loading is finished
     grid.unmaskBody();
  });
}
ParameterTypeDescription
loadMaskString | MaskConfig

The message to show in the load mask (next to the spinner) or a config object for a Mask.

Returns: Mask

Resumes CSS transitions after a row / event has been updated

Runs a function with transitions enabled (row height, event size etc.). Useful if you want to alter the UI state with a transition.

ParameterTypeDescription
fnfunction

The function to run

Returns: Promise -

A promise which resolves when the transition duration has expired

Suspends CSS transitions after a row / event has been updated

Multiple calls to suspendAnimations stack up, and will require an equal number of resumeAnimations calls to actually resume animations.

Removes highlighting from the specified cells. If no cells are passed, all highlighted cells will be un-highlighted.

grid.unhighlightCells({ cells : { id : 1, columnId : 'name' } }); // single cell
grid.unhighlightCells({ cells : [{ id : 1, columnId : 'name' }, { id : 2, columnId : 'age' }] }); // multiple cells
grid.unhighlightCells(); // all cells
ParameterTypeDescription
optionsObject

Options config object

options.cellsGridLocationConfig | GridLocationConfig[]

The cells to un-highlight. Omit this to un-highlight all.

Hide the load mask.

addPluginsPluggable
attachTooltipstaticWidget
fromElementstaticWidget
fromSelectorstaticWidget
getByIdstaticWidget
getPluginPluggable
hasFeatureGridFeatures
hasPluginPluggable
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Rendering

Triggers a render of all the cells in a column.

ParameterTypeDescription
columnColumn | Column[]
enableTransitionsBoolean

Set to false to disable transitions in cells

Rerender a single grid header

ParameterTypeDescription
columnColumn

The column to refresh

Rerenders all grid headers

Triggers a render of all the cells in the row for the passed record.

Since Grid uses virtualized rows, calling this method for a record that is not currently displayed in a row will not have any effect.

Manipulating records and Grid settings refreshes the Grid automatically. You should only need to call this function if you have outside data/settings unknown to the Grid that has changed and requires Grid to update the row to reflect the changes

ParameterTypeDescription
recordModel

The record whose row should be refreshed

Triggers a render of all the cells in the rows for the passed records. Leave the argument out to refresh all rows.

Since Grid uses virtualized rows, calling this method for records that are not currently displayed in rows will not have any effect.

Manipulating records and Grid settings refreshes the Grid automatically. You should only need to call this function if you have outside data/settings unknown to the Grid that has changed and requires Grid to update rows to reflect the changes

ParameterTypeDescription
recordsModel[]

The records whose rows should be refreshed

Rerenders the grids rows, headers and footers, completely replacing all row elements with new ones

Rerenders all grid rows, completely replacing all row elements with new ones

Resumes UI refreshes after updates to the underlying data.

Multiple calls to suspendRefresh stack up, and will require an equal number of resumeRefresh calls to actually resume UI refresh.

Specify false as the first param to not refresh if this call unblocked the refresh suspension.

ParameterTypeDescription
triggerBoolean

true to trigger a refresh, if this resume unblocks suspension

Suspends UI refreshes after updates to the underlying data.

Multiple calls to suspendRefresh stack up, and will require an equal number of resumeRefresh calls to actually resume UI refresh.

Rows

Get a Row for either a record, a record id or an HTMLElement

ParameterTypeDescription
recordOrIdHTMLElement | Model | String | Number

Record or record id or HTMLElement

Returns: Row -

Found Row or null if record not rendered

Scrolling

Deactivates automatic scrolling of a subGrid when mouse is moved closed to the edges

ParameterTypeDescription
subGridSubGrid | String | SubGrid[] | String[]

A subGrid instance or its region name or an array of either

Activates automatic scrolling of a subGrid when mouse is moved closed to the edges. Useful when dragging DOM nodes from outside this grid and dropping on the grid.

ParameterTypeDescription
subGridSubGrid | String | SubGrid[] | String[]

A subGrid instance or its region name or an array of either

Restore scroll state. If state is not specified, restores the last stored state.

ParameterTypeDescription
stateObject

Scroll state, optional

Scrolls a locally available record's cell into view (if it is not already).

ParameterTypeDescription
cellContextGridLocationConfig | GridLocation

Cell selector { id: recordId, column: 'columnName' }

Returns: Promise -

A promise which resolves when the specified cell has been scrolled into view.

Scrolls a column into view (if it is not already)

ParameterTypeDescription
columnColumn | String | Number

Column name (data) or column index or actual column object.

optionsBryntumScrollOptions

How to scroll.

Returns: Promise -

If the column exists, a promise which is resolved when the column header element has been scrolled into view.

Scrolls a locally available record's row into view. If row isn't rendered it tries to calculate position. Accepts the BryntumScrollOptions column property

ParameterTypeDescription
recordOrIdModel | String | Number

Record or record id

optionsGridScrollOptions

How to scroll.

Returns: Promise -

A promise which resolves when the specified row has been scrolled into view.

Scroll all the way down

Returns: Promise -

A promise which resolves when the bottom is reached.

Scroll all the way up

Returns: Promise -

A promise which resolves when the top is reached.

Stores the scroll state. Returns an objects with a scrollTop number value for the entire grid and a scrollLeft object containing a left position scroll value per sub grid.

Returns: Object

Configuration

applyDefaultsstaticBase

Events

Float & align

alignToWidget
setXYWidget
showByWidget
toFrontWidget

Lifecycle

createstaticWidget
destroystaticBase
initClassstaticWidget

Other

addContainer
composeWidget
createOnFrameDelayable
disableWidget
enableWidget
focusWidget
getAtContainer
getWidgetByIdContainer
insertContainer
LstaticLocalizable
maskWidget
onEvents
recomposeWidget
relayAllEvents
removeContainer
removeAllContainer
resetValuesContainer
setValuesContainer
triggerEvents
unEvents
unmaskWidget

Selection

deselectAllGridSelection
deselectCellGridSelection
deselectCellsGridSelection
deselectRowGridSelection
deselectRowsGridSelection
isCellSelectedGridSelection
isSelectableGridSelection
isSelectedGridSelection
selectAllGridSelection
selectCellGridSelection
selectCellRangeGridSelection
selectCellsGridSelection
selectRangeGridSelection
selectRowGridSelection
selectRowsGridSelection

State

SubGrid

getSubGridGridSubGrids

Visibility

hideWidget
showWidget

Widget hierarchy

closestWidget
containsWidget
ownsWidget
queryWidget
queryAllWidget
upWidget

Events

46

Fires before a row is rendered.

// Adding a listener using the "on" method
gridBase.on('beforeRenderRow', ({ source, row, record, recordIndex }) => {

});
ParameterTypeDescription
sourceGrid

The firing Grid instance.

rowRow

The row about to be rendered.

recordModel

The record for the row.

recordIndexNumber

The zero-based index of the record.

Grid rows are about to be rendered

// Adding a listener using the "on" method
gridBase.on('beforeRenderRows', ({ source }) => {

});
ParameterTypeDescription
sourceGrid

This grid.

Fired when data in the store changes.

Basically a relayed version of the store's own change event, decorated with a store property. See the store change event documentation for more information.

// Adding a listener using the "on" method
gridBase.on('dataChange', ({ source, store, action, record, records, changes }) => {

});
ParameterTypeDescription
sourceGrid

Owning grid

storeStore

The originating store

actionremove | removeAll | add | clearchanges | filter | update | dataset | replace

Name of action which triggered the change. May be one of:

  • 'remove'
  • 'removeAll'
  • 'add'
  • 'clearchanges'
  • 'filter'
  • 'update'
  • 'dataset'
  • 'replace'
recordModel

Changed record, for actions that affects exactly one record ('update')

recordsModel[]

Changed records, passed for all actions except 'removeAll'

changesObject

Passed for the 'update' action, info on which record fields changed

Fires after a row is rendered.

// Adding a listener using the "on" method
gridBase.on('renderRow', ({ source, row, record, recordIndex }) => {

});
ParameterTypeDescription
sourceGrid

The firing Grid instance.

rowRow

The row that has been rendered.

recordModel

The record for the row.

recordIndexNumber

The zero-based index of the record.

Grid rows have been rendered

// Adding a listener using the "on" method
gridBase.on('renderRows', ({ source }) => {

});
ParameterTypeDescription
sourceGrid

This grid.

Grid has scrolled vertically

// Adding a listener using the "on" method
gridBase.on('scroll', ({ source, scrollTop }) => {

});
ParameterTypeDescription
sourceGrid

The firing Grid instance.

scrollTopNumber

The vertical scroll position.

Fires after a sub grid is collapsed.

// Adding a listener using the "on" method
gridBase.on('subGridCollapse', ({ source, subGrid }) => {

});
ParameterTypeDescription
sourceGrid

The firing Grid instance

subGridSubGrid

The sub grid instance

Fires after a sub grid is expanded.

// Adding a listener using the "on" method
gridBase.on('subGridExpand', ({ source, subGrid }) => {

});
ParameterTypeDescription
sourceGrid

The firing Grid instance

subGridSubGrid

The sub grid instance

catchAllEvents
cellClickGridElementEvents
cellContextMenuGridElementEvents
cellDblClickGridElementEvents
cellMouseEnterGridElementEvents
cellMouseLeaveGridElementEvents
cellMouseOutGridElementEvents
cellMouseOverGridElementEvents
destroyEvents
dragSelectingGridSelection
expandPanel
focusInWidget
focusOutWidget
headerClickGridElementEvents
hideWidget
mouseOutGridElementEvents
mouseOverGridElementEvents
paintWidget
readOnlyWidget
recomposeWidget
resizeWidget
responsiveGridResponsive
rowMouseEnterGridElementEvents
rowMouseLeaveGridElementEvents
selectionChangeGridSelection
selectionModeChangeGridSelection
showWidget

Event handlers

46

Called before a row is rendered.

new GridBase({
    onBeforeRenderRow({ source, row, record, recordIndex }) {

    }
});
ParameterTypeDescription
sourceGrid

The firing Grid instance.

rowRow

The row about to be rendered.

recordModel

The record for the row.

recordIndexNumber

The zero-based index of the record.

Grid rows are about to be rendered

new GridBase({
    onBeforeRenderRows({ source }) {

    }
});
ParameterTypeDescription
sourceGrid

This grid.

Called when data in the store changes.

Basically a relayed version of the store's own change event, decorated with a store property. See the store change event documentation for more information.

new GridBase({
    onDataChange({ source, store, action, record, records, changes }) {

    }
});
ParameterTypeDescription
sourceGrid

Owning grid

storeStore

The originating store

actionremove | removeAll | add | clearchanges | filter | update | dataset | replace

Name of action which triggered the change. May be one of:

  • 'remove'
  • 'removeAll'
  • 'add'
  • 'clearchanges'
  • 'filter'
  • 'update'
  • 'dataset'
  • 'replace'
recordModel

Changed record, for actions that affects exactly one record ('update')

recordsModel[]

Changed records, passed for all actions except 'removeAll'

changesObject

Passed for the 'update' action, info on which record fields changed

Called after a row is rendered.

new GridBase({
    onRenderRow({ source, row, record, recordIndex }) {

    }
});
ParameterTypeDescription
sourceGrid

The firing Grid instance.

rowRow

The row that has been rendered.

recordModel

The record for the row.

recordIndexNumber

The zero-based index of the record.

Grid rows have been rendered

new GridBase({
    onRenderRows({ source }) {

    }
});
ParameterTypeDescription
sourceGrid

This grid.

Grid has scrolled vertically

new GridBase({
    onScroll({ source, scrollTop }) {

    }
});
ParameterTypeDescription
sourceGrid

The firing Grid instance.

scrollTopNumber

The vertical scroll position.

Called after a sub grid is collapsed.

new GridBase({
    onSubGridCollapse({ source, subGrid }) {

    }
});
ParameterTypeDescription
sourceGrid

The firing Grid instance

subGridSubGrid

The sub grid instance

Called after a sub grid is expanded.

new GridBase({
    onSubGridExpand({ source, subGrid }) {

    }
});
ParameterTypeDescription
sourceGrid

The firing Grid instance

subGridSubGrid

The sub grid instance

onCellClickGridElementEvents
onCellContextMenuGridElementEvents
onCellDblClickGridElementEvents
onCellMouseEnterGridElementEvents
onCellMouseLeaveGridElementEvents
onCellMouseOutGridElementEvents
onCellMouseOverGridElementEvents
onDestroyEvents
onDragSelectingGridSelection
onFocusInWidget
onHeaderClickGridElementEvents
onHideWidget
onMouseOutGridElementEvents
onMouseOverGridElementEvents
onPaintWidget
onResizeWidget
onResponsiveGridResponsive
onRowMouseEnterGridElementEvents
onRowMouseLeaveGridElementEvents
onSelectionChangeGridSelection
onShowWidget

Typedefs

15

Config object that specifies empty text configuration.

ParameterTypeDescription
regionlocked | normal | String

The grid region to add the empty text to

ParameterTypeDescription
blockstart | end | center | nearest

How far to scroll the element.

edgeOffsetNumber

edgeOffset A margin around the element or rectangle to bring into view.

animateAnimateScrollOptions | Boolean | Number

Set to true to animate the scroll by 300ms, or the number of milliseconds to animate over, or an animation config object.

highlightBoolean | function | String

Set to true to highlight the element when it is in view. May be a function or the name of a method which is called passing an array of elements, to provide customized highlighting. The function will be called with an array of row elements as an argument.

focusBoolean

Set to true to focus the element when it is in view.

xBoolean

Pass as false to disable scrolling in the X axis.

yBoolean

Pass as false to disable scrolling in the Y axis.

maxWidthNumber

How much of the target's width to bring into view if the target is wider.

maxHeightNumber

How much of the target's height to bring into view if the target is taller.

columnString

Field name or ID of the column, or the Column instance to scroll to.

extendTimeAxisBoolean

Only applies when scrolling an event into view in Scheduler. By default, if the requested event is outside the time axis, the time axis is extended.

viewportRectangle

An optional definition of the scrollable viewport if it has to differ from the actual client area of this Scroller's element.

Additional options for the preserveScroll configuration.

ParameterTypeDescription
overscrollBoolean

When there is not enough content remaining in the viewport to preserve the current scroll position (for example, if rows below have been removed), allow the viewport to temporarily include empty space beyond the available content, in order to avoid scrolling.

AlignSpecWidget
ColorWidget
ColumnStateGridState
GridSelectionModeGridSelection
GridStateInfoGridState
ResponsiveLevelConfigGridResponsive
SubGridStateGridState

CSS variables

83
NameDescription
--b-grid-column-transition-durationTransition duration for column operations such as showing, hiding and collapsing
--b-grid-row-transition-durationTransition duration for row operations such as adding and removing
--b-grid-empty-paddingPadding for the message shown when the grid is empty
--b-grid-empty-colorText color for the message shown when the grid is empty
--b-grid-panel-header-paddingPadding for the grid panel header (when having a title or panel tools)
--b-grid-panel-header-border-bottomBottom border for the grid panel header (when having a title or panel tools)
--b-grid-backgroundGrid background color
--b-grid-cell-border-widthGrid cell border width. By default also applies to headers
--b-grid-cell-gapGrid cell inner gap
--b-grid-cell-padding-blockGrid cell padding block. Defaults to 0, since cells are sized programmatically and content is centered vertically
--b-grid-cell-padding-inlineGrid cell padding inline. By default also applies to headers
--b-grid-cell-font-sizeGrid cell font size
--b-grid-cell-font-weightGrid cell font weight
--b-grid-row-heightGrid's default row height, if not set programmatically or through data
--b-grid-row-border-widthGrid row border width (bottom border)
--b-grid-row-zindexGrid row z-index
--b-grid-splitter-widthGrid splitter width, when not using the RegionResize feature
--b-grid-cell-border-colorGrid cell border color
--b-grid-cell-backgroundGrid cell background
--b-grid-cell-colorGrid cell color
--b-grid-row-border-colorGrid row border color (defaults to use cell border color)
--b-grid-cell-dirty-colorGrid cell dirty indicator color
--b-grid-splitter-narrow-colorGrid splitter color, when not using the RegionResize feature
--b-grid-row-placeholder-colorRow "Skeleton" background color when lazy loading
--b-grid-cell-highlight-colorBackground color for highlighted cells in color mode
Focused
--b-grid-cell-focused-outline-widthGrid cell focused outline width
--b-grid-cell-focused-outline-colorGrid cell focused outline color
Hovered
--b-grid-cell-hover-backgroundBackground for hovered cells
--b-grid-cell-hover-selected-backgroundBackground for hovered and selected cells
Selected
--b-grid-cell-selected-colorGrid cell color when selected & hovered
--b-grid-cell-selected-backgroundBackground for selected cells

Inherited