Keytable: is it working? How do I know?
Keytable: is it working? How do I know?
I have tried installing keytable with datatables but it doesn't seem like it's working. Here's the integration code:
[code]
$(document).ready(function() {
var oTable = $('#results').dataTable( {
"aaSorting": [[ 4, "desc" ]],
"bJQueryUI": true,
"bFilter": false,
"bAutoWidth": false,
"sWidth": "50%",
"sPaginationType": "full_numbers",
"sDom": '<"topL"i>rt<"topR"l>rt<"bottom"p>',
"aoColumns" : [null, null, { "bSearchable": true, "bVisible": false },{ "bSearchable": true, "bVisible": false }]
} );
var keys = new KeyTable( {
"table": document.getElementById('results'),
"datatable": oTable
} );
} );
[/code]
Did I miss something here?
[code]
$(document).ready(function() {
var oTable = $('#results').dataTable( {
"aaSorting": [[ 4, "desc" ]],
"bJQueryUI": true,
"bFilter": false,
"bAutoWidth": false,
"sWidth": "50%",
"sPaginationType": "full_numbers",
"sDom": '<"topL"i>rt<"topR"l>rt<"bottom"p>',
"aoColumns" : [null, null, { "bSearchable": true, "bVisible": false },{ "bSearchable": true, "bVisible": false }]
} );
var keys = new KeyTable( {
"table": document.getElementById('results'),
"datatable": oTable
} );
} );
[/code]
Did I miss something here?
This discussion has been closed.
Replies
Allan
So that's how I can tell it's working? Ensure the CSS is correct and it should always highlight the cells?
Also, does keytables address the issue with the pagination not being accessible?
Thanks Allan..
> Also, does keytables address the issue with the pagination not being accessible?
To some extent I guess it could be considered as such. It does allow pagination via the keyboard, but the real solution is to make the pagination directly accessible itself by first using A tags for the pagination elements and also adding ARIA support.
Allan
So here's what I've got (per your example), but I still have no keytables functionality:
[code]
oTable = null;
hidden_column = 2; // change this to the index of your column
$(document).ready(function() {
var oTable = $('#results').dataTable( {
"bJQueryUI": true,
"bAutoWidth": true,
"sWidth": "50%",
"aoColumns" : [null, null, { "bSearchable": true, "bVisible": false }],
"sPaginationType": "full_numbers",
"sDom": '<"topL"i>rt<"topR"l>rt<"bottom"p>'
} );
var keys = new KeyTable( {
"table": document.getElementById('results'),
"datatable": oTable
} );
} );
[/code]
First line of table:
[code]
[/code]
CSS:
[code]
/*
* KeyTable
*/
table.KeyTable td {
border: 3px solid transparent;
}
table.KeyTable td.focus {
border: 3px solid #3366FF;
}
table.display tr.gradeA {
background-color: #eeffee;
}
table.display tr.gradeC {
background-color: #ddddff;
}
table.display tr.gradeX {
background-color: #ffdddd;
}
table.display tr.gradeU {
background-color: #ddd;
}
div.box {
height: 100px;
padding: 10px;
overflow: auto;
border: 1px solid #8080FF;
background-color: #E5E5FF;
}
[/code]
The CSS rules are looking for a table with the class "KeyTable". To test it out, make it so it is "table", not "table.KeyTable."
Are you positive that the class "focus" is not being applied to elements that you click on?
Here's my updated CSS but there were no changes:
[code]
/*
* KeyTable
*/
table td {
border: 3px solid transparent;
}
table td.focus {
border: 3px solid #3366FF;
}
table.display tr.gradeA {
background-color: #eeffee;
}
table.display tr.gradeC {
background-color: #ddddff;
}
table.display tr.gradeX {
background-color: #ffdddd;
}
table.display tr.gradeU {
background-color: #ddd;
}
div.box {
height: 100px;
padding: 10px;
overflow: auto;
border: 1px solid #8080FF;
background-color: #E5E5FF;
}
[/code]