keys.disable()
Disable KeyTable's interactions (mouse and keyboard).
Please note - this property requires the KeyTable extension for DataTables.
Description
KeyTable is typically used as an enabler for other interaction options with a DataTable, such as editing a cell's content or triggering an action that will display additional information about a cell or row. In such circumstances it is important that we have the ability to disable KeyTable's own listeners so keystrokes are not acted upon. This method provides exactly that ability.
As an example, consider the use of KeyTable with Editor where you wish to activate inline editing with a keystroke, but then disable KeyTable from taking other actions while the editing is in progress. This is what the keys.editor
option provides built into KeyTable.
Type
function keys.disable()
- Description:
Disable KeyTable. Please note that this disallows future interactions with the table (until re-enabled), but does not cause the table to blur (i.e. loose focus). If a cell has focus, that focus will be retained after this method has been called.
- Returns:
DataTables API instance
Example
Disable KeyTable immediately on initialisation:
var table = new DataTable('#myTable', {
keys: true
});
table.keys.disable();
Related
The following options are directly related and may also be useful in your application development.