onColumnEvents([callback], [remove])
Class: Table.
Description:
Gets, registers or unregisters a column event handler function. This event handler is called when a column is inserted, removed, resized, or moved (reordered).
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
function |
The event handler function. Receives an event object. |
|
|
|
boolean |
false |
Set to |
Returns:
An array of handler functions if no arguments are passed, otherwise this component for method chaining.
Type: Table | Array.<function()>
Examples:
// Example event object:
const e = {
target: Table, // The Table component that triggered the event.
type: string, // "insert", "remove", "move", "resize".
index: number // Only when type is "insert", "remove", or "resize". Index of the column.
fromIndex: number, // Only when type is "move". Indicates the previous index of the column.
toIndex: number, // Only when type is "move". Indicates the new index of the column.
fromSize: number, // Only when type is "resize". Indicates the previous size of the column.
toSize: number, // Only when type is "resize". Indicates the new size of the column.
interactive: boolean // `true` when column was moved by the user interacting with the GUI. `false` when it was made programmatically.
};
