This site contains the legacy documentation for DataTables v1.9 and earlier for reference only.
DataTables 1.9 was End Of Life in 2014.
Do not use it for new work.
The current release of DataTables can always be found on
DataTables.net.
KeyTable v1.2.0
Options
Although the majority of the interaction with KeyTable is through the API, for dealing with events etc, KeyTable provides a variety of options to help customise the display to your needs. The options are listed below.
Initialisation
Initialisation of KeyTable is done by creating a new instance of the $.fn.dataTable.KeyTable class. For example:
$(document).ready( function () {
var oTable = $('#example').dataTable();
var keys = new $.fn.dataTable.KeyTable( oTable );
} );
KeyTable options
focus Show details
|
Which element in the table is to be focused on initially. This can either be a TD node element, or a set of coordinates (for example [0, 5]) |
Default: |
null |
Type: |
Node or Array |
Code example: |
$(document).ready( function () {
var table = $('#example').dataTable();
var keys = new $.fn.dataTable.KeyTable( table, {
"focus": [ 1, 0 ]
} );
} );
|
focusClass Show details
|
The class to be used for the focused cell |
Default: |
focus |
Type: |
String |
Code example: |
$(document).ready( function () {
var table = $('#example').dataTable();
var keys = new $.fn.dataTable.KeyTable( table, {
"focusClass": "myClass"
} );
} );
|
form Show details
|
Indicate if the table part of a form or not. If so then it will handle tabbing for you. |
Default: |
false |
Type: |
Boolean |
Code example: |
$(document).ready( function () {
var table = $('#example').dataTable();
var keys = new $.fn.dataTable.KeyTable( table, {
"form": true
} );
} );
|
initScroll Show details
|
Scroll the viewport automatically to the first cell |
Default: |
true |
Type: |
Boolean |
Code example: |
$(document).ready( function () {
var oTable = $('#example').dataTable();
var keys = new KeyTable( {
"table": document.getElementById('example'),
"datatable": oTable,
"initScroll": false )
} );
} );
|
tabIndex Show details
|
Tab index to give to the hidden input field if using KeyTable as a form element. |
Default: |
null |
Type: |
Integer |
Code example: |
$(document).ready( function () {
var table = $('#example').dataTable();
var keys = new $.fn.dataTable.KeyTable( table, {
"form": true,
"tabIndex": 5
} );
} );
|