{hero}

key-refocus

Since: KeyTable 2.3.0

KeyTable has refocused a cell.
Please note - this property requires the KeyTable extension for DataTables.

Description

The key-focus event can be used to determine when a cell has been focused on, but will not be triggered again if a cell is clicked upon when it already has focus. While this is done to present unnecessary processing, there may be occasions where this information is useful.

To that end, this event behaves exactly like key-focus, but will only be triggered when a cell which already has focus is focused on again (either by a click event, or API action).

Type

function function( e, datatable, cell, originalEvent )

Parameters:

Example

Show information about a cell when focus is activated, including reclicking on an already focused cell:

var table = new DataTable('#myTable', {
	keys: true
});

table
	.on('key-focus key-refocus', function (e, datatable, cell, originalEvent) {
		var rowData = datatable.row(cell.index().row).data();

		$('#details').html('Cell in ' + rowData[0] + ' focused');
	})
	.on('key-blur', function (e, datatable, cell) {
		$('#details').html('No cell selected');
	});

Related

The following options are directly related and may also be useful in your application development.