RegionResize

Makes the splitter between grid sections draggable, to let users resize, and collapse/expand the sections.

Region resize
//<code-header>
fiddle.title = 'Region resize';
//</code-header>
targetElement.innerHTML = '<p>Drag the splitter between grid regions to resize</p>';
const grid = new Grid({
    appendTo : targetElement,

    // makes grid as high as it needs to be to fit rows
    autoHeight : true,

    features : {
        // enabled region resize
        regionResize : true
    },

    data : DataGenerator.generateData(5),

    columns : [
        { field : 'firstName', text : 'First name', width : 150, locked : true },
        { field : 'surName', text : 'Surname', width : 150, locked : true },
        { field : 'city', text : 'City', flex : 1 },
        { field : 'team', text : 'Team', flex : 1 },
        { field : 'score', text : 'Score', flex : 1 },
        { field : 'rank', text : 'Rank', flex : 1 }
    ]
});

// enable RegionResize
const grid = new Grid({
  features: {
    regionResize: true
  }
});

If you use two regions, and you would like to prevent resizing/expanding the first (left section, rightmost in RTL), set maxWidth and width to the same value.

// enable RegionResize
const grid = new Grid({
  features: {
    regionResize: true
  },
  subGridConfigs : {
        locked : {
            width : 400,
            // prevent making the left section wider than 400px
            maxWidth : 400
        },
        normal : {
            flex : 1
        }
    }
});

This feature is disabled by default.

Configs

12

Common

disabledInstancePlugin
listenersEvents

Other

animateCollapseExpand: Boolean= truedeprecatedAlso a property

Set to false to not use transitions when expanding or collapsing a sub grid

This flag prevents dragging if set to false but the collapse / expand buttons will still be functional.

Set to false to hide the splitter's collapse/expand buttons

Misc

clientInstancePlugin
localeClassLocalizable
localizableLocalizable

Properties

18

Common

disabledInstancePlugin

Class hierarchy

isRegionResize: Boolean= truereadonly
Identifies an object as an instance of RegionResize class, or subclass thereof.
isRegionResize: Boolean= truereadonlystatic
Identifies an object as an instance of RegionResize class, or subclass thereof.
isEventsEvents
isInstancePluginInstancePlugin
isLocalizableLocalizable

Other

animateCollapseExpand: Boolean= truedeprecatedAlso a config

Set to false to not use transitions when expanding or collapsing a sub grid

This flag prevents dragging if set to false but the collapse / expand buttons will still be functional.

Set to false to hide the splitter's collapse/expand buttons

Lifecycle

configBase

Misc

clientInstancePlugin
localeHelperLocalizable
localeManagerLocalizable

Functions

28

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

doDisableInstancePlugin
initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

LstaticLocalizable
onEvents
relayAllEvents
triggerEvents
unEvents

Events

9

Fired by the Grid when the collapse icon is clicked. Return false to prevent the default collapse action, if you want to implement your own behavior.

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

});
ParameterTypeDescription
sourceGrid

The Grid instance.

subGridSubGrid

The subgrid

domEventEvent

The native DOM event

Fired by the Grid after a sub-grid has been resized using the splitter

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

});
ParameterTypeDescription
sourceGrid

The Grid instance.

subGridSubGrid

The resized subgrid

domEventEvent

The native DOM event

Fired by the Grid when a sub-grid resize gesture starts

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

});
ParameterTypeDescription
sourceGrid

The Grid instance.

subGridSubGrid

The subgrid about to be resized

domEventEvent

The native DOM event

Fired by the Grid when the expand icon is clicked. Return false to prevent the default expand action, if you want to implement your own behavior.

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

});
ParameterTypeDescription
sourceGrid

The Grid instance.

subGridSubGrid

The subgrid

domEventEvent

The native DOM event

catchAllEvents
destroyEvents
disableInstancePlugin
enableInstancePlugin

Event handlers

9

Called by the Grid when the collapse icon is clicked. Return false to prevent the default collapse action, if you want to implement your own behavior.

new RegionResize({
    onSplitterCollapseClick({ source, subGrid, domEvent }) {

    }
});
ParameterTypeDescription
sourceGrid

The Grid instance.

subGridSubGrid

The subgrid

domEventEvent

The native DOM event

Called by the Grid after a sub-grid has been resized using the splitter

new RegionResize({
    onSplitterDragEnd({ source, subGrid, domEvent }) {

    }
});
ParameterTypeDescription
sourceGrid

The Grid instance.

subGridSubGrid

The resized subgrid

domEventEvent

The native DOM event

Called by the Grid when a sub-grid resize gesture starts

new RegionResize({
    onSplitterDragStart({ source, subGrid, domEvent }) {

    }
});
ParameterTypeDescription
sourceGrid

The Grid instance.

subGridSubGrid

The subgrid about to be resized

domEventEvent

The native DOM event

Called by the Grid when the expand icon is clicked. Return false to prevent the default expand action, if you want to implement your own behavior.

new RegionResize({
    onSplitterExpandClick({ source, subGrid, domEvent }) {

    }
});
ParameterTypeDescription
sourceGrid

The Grid instance.

subGridSubGrid

The subgrid

domEventEvent

The native DOM event

onDestroyEvents
onDisableInstancePlugin
onEnableInstancePlugin

Typedefs

1

CSS variables

9
NameDescription
--b-grid-splitter-zindexSplitter z-index
--b-region-resize-splitter-widthSplitter width
--b-region-resize-splitter-colorSplitter color
--b-region-resize-button-colorColor for the expand / collapse buttons showed on hover
Collapsed
--b-region-resize-splitter-collapsed-widthSplitter width when collapsed
Hovered
--b-region-resize-splitter-width-hoverSplitter width when hovering (also used as the invisible interactable area width)
--b-region-resize-splitter-hover-colorSplitter color when hovered
--b-region-resize-button-hover-colorColor for the expand / collapse buttons showed on hover
Touched
--b-region-resize-splitter-touch-width-hoverSplitter width when touched (also used as the invisible touch area width)