column-sizing
Since: DataTables 1.10
Column sizing event - fired when the column widths are recalculated.
Description
This event is fired whenever DataTables adjusts the column widths in the table and can be used by plug-ins to adjust any additional DOM elements they might have drawn on the page to take account of those changes.
Please note that, as with all DataTables emitted events, the event object has a DataTables API instance available on it in the dt property.
Type
function( e, settings )
Parameters:
| Name | Type | Optional | |
|---|---|---|---|
| 1 | e | No | |
Event object | |||
| 2 | settings | No | |
DataTables settings object | |||
Example
Notify when the column widths are recalculated:
let table = new DataTable('#myTable');
table.on('column-sizing', function (e, settings) {
console.log('Column width recalculated in table');
});Related
The following options are directly related and may also be useful in your application development.