ColumnResize

Enables user to resize columns by dragging a handle on the right hand side of the header. To get notified about column resize listen to change event on columns store.

This feature is enabled by default.

Column resize
//<code-header>
fiddle.title = 'Column resize';
//</code-header>
targetElement.innerHTML = '<p>Drag the edge between two headers to resize columns</p>';
const grid                = new Grid({
    appendTo : targetElement,

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

    features : {
        // this feature is enabled by default,
        // so no need for this unless you have changed defaults
        columnResize : true
    },

    data : DataGenerator.generateData(5),

    columns : [
        { field : 'firstName', text : 'First name', width : 150 },
        { field : 'surName', text : 'Surname', width : 150 },
        { type : 'date', field : 'start', text : 'Start', width : 150 },
        { type : 'date', field : 'finish', text : 'Finish', flex : 1 }
    ]
});

Configs

10

Common

disabledInstancePlugin
listenersEvents

Other

liveResize: auto | Boolean= auto

Resize all cells below a resizing header during dragging. 'auto' means true on non-mobile platforms.

Misc

clientInstancePlugin
localeClassLocalizable
localizableLocalizable

Properties

15

Common

disabledInstancePlugin

Class hierarchy

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

Lifecycle

configBase

Misc

clientInstancePlugin
localeHelperLocalizable
localeManagerLocalizable

Other

Functions

28

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

doDisableInstancePlugin
initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

LstaticLocalizable
onEvents
relayAllEvents
triggerEvents
unEvents

Events

8

This event is fired prior to starting a column resize gesture. The resize is canceled if a listener returns false.

// Adding a listener using the "on" method
columnResize.on('beforeColumnResize', ({ source, column, domEvent }) => {

});
ParameterTypeDescription
sourceGrid

The grid instance

columnColumn

The column

domEventEvent

The browser event

This event is fired after a resize gesture is completed.

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

});
ParameterTypeDescription
sourceGrid

The grid instance

columnColumn

The resized column

domEventEvent

The browser event

This event is fired when a column resize gesture starts.

// Adding a listener using the "on" method
columnResize.on('columnResizeStart', ({ source, column, domEvent }) => {

});
ParameterTypeDescription
sourceGrid

The grid instance

columnColumn

The column

domEventEvent

The browser event

catchAllEvents
destroyEvents
disableInstancePlugin
enableInstancePlugin

Event handlers

8

This event is called prior to starting a column resize gesture. The resize is canceled if a listener returns false.

new ColumnResize({
    onBeforeColumnResize({ source, column, domEvent }) {

    }
});
ParameterTypeDescription
sourceGrid

The grid instance

columnColumn

The column

domEventEvent

The browser event

This event is called after a resize gesture is completed.

new ColumnResize({
    onColumnResize({ source, column, domEvent }) {

    }
});
ParameterTypeDescription
sourceGrid

The grid instance

columnColumn

The resized column

domEventEvent

The browser event

This event is called when a column resize gesture starts.

new ColumnResize({
    onColumnResizeStart({ source, column, domEvent }) {

    }
});
ParameterTypeDescription
sourceGrid

The grid instance

columnColumn

The column

domEventEvent

The browser event

onDestroyEvents
onDisableInstancePlugin
onEnableInstancePlugin

Typedefs

1

CSS variables

4
NameDescription
--b-column-resize-handle-widthResize handle width (positioned between columns)
--b-column-resize-touch-handle-widthResize handle width for touch devices
--b-column-resize-header-resizing-backgroundBackground color of the header during resize
--b-column-resize-touch-resizing-iconIcon to show when resizing a column on touch devices (font icon char)