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.

Configs

78

Common

listenersEvents

Layout

weight: Number

The subgrid "weight" determines its position among its SubGrid siblings. Higher weights go further right.

alignSelfWidget
dockWidget
flexWidget
heightWidget
hiddenWidget
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
textAlignWidget
widthWidget

Other

collapsed: Boolean= falseAlso a property

Set true to start subgrid collapsed. To operate collapsed state on subgrid use collapse/expand methods.

Column store, a store containing the columns for this SubGrid

region: String

Region (name) for this SubGrid

resizable: Boolean= true

Set to false to prevent this subgrid being resized with the RegionResize feature

columnWidget
rtlRTL
spanWidget

Accessibility

ariaLabelWidget
keyMapKeyMap

CSS

clsWidget
colorWidget
htmlClsWidget
styleWidget
uiWidget

DOM

adoptWidget
appendToWidget
contentWidget
datasetWidget
htmlWidget
idWidget
tagWidget
titleWidget

Float & align

alignWidget
anchorWidget
centeredWidget
draggableWidget
floatingWidget
xWidget
yWidget

Misc

dataFieldWidget
disabledWidget
localeClassLocalizable
localizableLocalizable
maskedWidget
ownerWidget
readOnlyWidget
refWidget
rippleWidget
tabWidget
tooltipWidget

Scrolling

Properties

68

Class hierarchy

isSubGrid: Boolean= truereadonly
Identifies an object as an instance of SubGrid class, or subclass thereof.
isSubGrid: Boolean= truereadonlystatic
Identifies an object as an instance of SubGrid class, or subclass thereof.
isDelayableDelayable
isEventsEvents
isKeyMapKeyMap
isLocalizableLocalizable
isWidgetWidget

Other

collapsed: Boolean= falseAlso a config

Set true to start subgrid collapsed. To operate collapsed state on subgrid use collapse/expand methods.

flex: Number | String

Get/set SubGrid flex, which also sets header and footer flex (if available).

rowElements: HTMLElement[]readonly

Get all row elements for this SubGrid.

Get the "viewport" for the SubGrid as a Rectangle

width: Number

Get/set SubGrid width, which also sets header and footer width (if available).

$namestaticWidget
columnWidget
rtlRTL
spanWidget
typestaticWidget

Accessibility

keyMapKeyMap

CSS

clsWidget

DOM

appendToWidget
contentWidget
datasetWidget
elementWidget
htmlWidget
idWidget
styleWidget

Float & align

xWidget
yWidget

Layout

alignSelfWidget
heightWidget
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget

Lifecycle

configBase

Misc

cellInfoWidget
disabledWidget
localeHelperLocalizable
localeManagerLocalizable
readOnlyWidget
refWidget
tabWidget
tooltipWidget

Visibility

hiddenWidget
isVisibleWidget

Widget hierarchy

ownerWidget
parentWidget

Functions

62

Other

Collapses subgrid. If collapsing subgrid is the only one expanded, next subgrid to the right (or previous) will be expanded.

let locked = grid.getSubGrid('locked');
locked.collapse().then(() => {
    console.log(locked.collapsed); // Logs 'True'
});

let normal = grid.getSubGrid('normal');
normal.collapse().then(() => {
    console.log(locked.collapsed); // Logs 'False'
    console.log(normal.collapsed); // Logs 'True'
});
ParameterTypeDescription
animateBoolean

Whether to animate the collapse.

Returns: Promise -

A Promise which resolves when this SubGrid is fully collapsed.

Expands subgrid.

grid.getSubGrid('locked').expand().then(() => console.log('locked grid expanded'));
ParameterTypeDescription
animateBoolean

Whether to animate the expand.

Returns: Promise -

A Promise which resolves when this SubGrid is fully expanded.

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

Scrolls a column into view (if it is not already). Called by Grid#scrollColumnIntoView, use it instead to not have to care about which SubGrid contains a column.

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.

Toggles this subgrid collapsed state.

ParameterTypeDescription
animateBoolean

Whether to animate the toggle.

Returns: Promise -

A Promise which resolves when this SubGrid is fully toggled.

composeWidget
createOnFrameDelayable
disableWidget
enableWidget
focusWidget
LstaticLocalizable
maskWidget
onEvents
recomposeWidget
relayAllEvents
triggerEvents
unEvents
unmaskWidget

Configuration

applyDefaultsstaticBase

Events

Float & align

alignToWidget
setXYWidget
showByWidget
toFrontWidget

Lifecycle

createstaticWidget
destroystaticBase
initClassstaticWidget

Misc

attachTooltipstaticWidget
fromElementstaticWidget
fromSelectorstaticWidget
getByIdstaticWidget
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Visibility

hideWidget
showWidget

Widget hierarchy

closestWidget
containsWidget
ownsWidget
queryWidget
queryAllWidget
upWidget

Events

16

Fires when the Grid is scrolling horizontally in one of its SubGrids

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

});
ParameterTypeDescription
sourceGrid

The firing Grid instance.

subGridSubGrid

The scrolling SubGrid instance.

scrollLeftNumber

The horizontal scroll position.

Fires after the Grid is done scrolling horizontally in one of its SubGrids

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

});
ParameterTypeDescription
sourceGrid

The firing Grid instance.

subGridSubGrid

The scrolling SubGrid instance.

scrollLeftNumber

The horizontal scroll position.

catchAllEvents
destroyEvents
focusInWidget
focusOutWidget
hideWidget
paintWidget
readOnlyWidget
recomposeWidget
resizeWidget
showWidget

Event handlers

16

Called when the Grid is scrolling horizontally in one of its SubGrids

new SubGrid({
    onHorizontalScroll({ source, subGrid, scrollLeft }) {

    }
});
ParameterTypeDescription
sourceGrid

The firing Grid instance.

subGridSubGrid

The scrolling SubGrid instance.

scrollLeftNumber

The horizontal scroll position.

Called after the Grid is done scrolling horizontally in one of its SubGrids

new SubGrid({
    onHorizontalScrollEnd({ source, subGrid, scrollLeft }) {

    }
});
ParameterTypeDescription
sourceGrid

The firing Grid instance.

subGridSubGrid

The scrolling SubGrid instance.

scrollLeftNumber

The horizontal scroll position.

onDestroyEvents
onFocusInWidget
onHideWidget
onPaintWidget
onResizeWidget
onShowWidget

Typedefs

6

CSS variables

20

Inherited