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.
//<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
Configs
10Other
Resize all cells below a resizing header during dragging.
'auto' means true on non-mobile platforms.
Misc
Properties
15
Properties
15Common
Class hierarchy
Other
Functions
28
Functions
28Configuration
Events
Misc
Other
Events
8
Events
8This 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Grid | The grid instance |
column | Column | The column |
domEvent | Event | 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Grid | The grid instance |
column | Column | The resized column |
domEvent | Event | 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Grid | The grid instance |
column | Column | The column |
domEvent | Event | The browser event |
Event handlers
8
Event handlers
8This 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 }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Grid | The grid instance |
column | Column | The column |
domEvent | Event | The browser event |
This event is called after a resize gesture is completed.
new ColumnResize({
onColumnResize({ source, column, domEvent }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Grid | The grid instance |
column | Column | The resized column |
domEvent | Event | The browser event |
This event is called when a column resize gesture starts.
new ColumnResize({
onColumnResizeStart({ source, column, domEvent }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Grid | The grid instance |
column | Column | The column |
domEvent | Event | The browser event |
Typedefs
1
Typedefs
1CSS variables
4
CSS variables
4| Name | Description |
|---|---|
--b-column-resize-handle-width | Resize handle width (positioned between columns) |
--b-column-resize-touch-handle-width | Resize handle width for touch devices |
--b-column-resize-header-resizing-background | Background color of the header during resize |
--b-column-resize-touch-resizing-icon | Icon to show when resizing a column on touch devices (font icon char) |