Keytable makes application sluggish
Keytable makes application sluggish
jattDaLann
Posts: 5Questions: 0Answers: 0
Dear All,
I've got a big table (2.5 thousand rows) with data and works alright performance wise, but when adding keytable to the datatable, it goes very sluggish, any solution to this?
[code]
var oTable = $("#userdealsPlayerSummary table").dataTable({
"aaSorting": [[6, "desc"]],
"bProcessing": true,
"iDisplayLength": 50,
"sPaginationType": "full_numbers",
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
var keys = new KeyTable({
"table": document.getElementById('userdealsTable'),
"datatable": oTable
});
[/code]
I've got a big table (2.5 thousand rows) with data and works alright performance wise, but when adding keytable to the datatable, it goes very sluggish, any solution to this?
[code]
var oTable = $("#userdealsPlayerSummary table").dataTable({
"aaSorting": [[6, "desc"]],
"bProcessing": true,
"iDisplayLength": 50,
"sPaginationType": "full_numbers",
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
var keys = new KeyTable({
"table": document.getElementById('userdealsTable'),
"datatable": oTable
});
[/code]
This discussion has been closed.
Replies
Allan
Search for ".click" in KeyTable.js and replace the existing if (_oDatatable ) block with the code below:
[code]
if ( _oDatatable )
{
/* original code
jQuery('td', _oDatatable.fnGetNodes()).click( _fnClick );
replacement code by Randy Brandt - tiredjake.com
requires jQuery 1.4.2 or newer
*/
jQuery(_oDatatable).delegate('td', 'click', function(event)
{
_fnSetFocus( this );
_fnCaptureKeys();
});
}
else
{
// original jQuery('td', _nBody).click( _fnClick );
jQuery(_nBody).delegate('td', 'click', function(event)
{
_fnSetFocus( this );
_fnCaptureKeys();
});
}
[/code]