onRowEvents([callback], [remove])

Class: Table.

Description:

Gets, registers or unregisters a row event handler function. This event handler is called when rows are inserted, removed, or cell value was updated (also check out onChange() event handler for to simply detect a cell value change).

Parameters:

Name Type Default Description

[callback]

function

The event handler function. Receives an event object.

[remove]

boolean

false

Set to true to unregister the event handler.

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: object,        // The Table component that triggered the event.
  type: string,          // "insert", "remove", "update".
  row: number,           // Only when one row was effected. Index of the row.
  column: number         // Only when type is "update". Column index of effected cell. Value of -1 means that all columns were effected.
  fromRow: number        // Only when multiple rows were effected. Indicates beginning index within the range of effected rows.
  toRow: number          // Only when multiple rows were effected. Indicates the last index within the range of effected rows.
  interactive: boolean   // Only when type is "update". `true` when update was made by the user interacting with the GUI. `false` when update was made programmatically.
};