Perfomance problem loading huge table
Perfomance problem loading huge table
jattDaLann
Posts: 5Questions: 0Answers: 0
Dear All(an),
I've been using datatables with great results, and am now using keytable with jedit-plugin to be able to edit the table and saving it.
However my tables are big, with couple of thousand rows, and it takes quite some time to load this. Some of the time has to do with the dataloading and some would be the datatable. I'm wondering why I'm having these performance issues when the datatable is supposed to be quite fast. Is there any settings below which could be an issue, or could I partly load the table etc?
This is how I've set up the datatable:
[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"]]
});
/* ************************************************************************ */
/* MAKE A TABLE EDITABLE */
/* ************************************************************************ */
var keys = new KeyTable({
"table": document.getElementById('userdealsTable'),
"datatable": oTable
});
/* Apply a return key event to each cell in the table */
$('#userdealsTable tbody td').each(function() {
keys.event.action(this, function(nCell) {
/* Block KeyTable from performing any events while jEditable is in edit mode */
keys.block = true;
/* Initialise the Editable instance for this table */
$(nCell).editable(function(sVal) {
/* Submit function (local only) - unblock KeyTable */
keys.block = false;
return sVal;
}, {
"onblur": 'submit',
"onreset": function() {
/* Unblock KeyTable, but only after this 'esc' key event has finished. Otherwise
* it will 'esc' KeyTable as well
*/
setTimeout(function() { keys.block = false; }, 0);
}
});
/* Dispatch click event to go into edit mode - Saf 4 needs a timeout... */
setTimeout(function() { $(nCell).click(); }, 0);
});
});
/* Apply the jEditable handlers to the table */
$('td', oTable.fnGetNodes()).editable('/Affiliation/EditDataTable', {
"callback": function(sValue, y) {
var aPos = oTable.fnGetPosition(this);
oTable.fnUpdate(sValue, aPos[0], aPos[1]);
},
"submitdata": function(value, settings) {
return {
"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition(this)[2]
};
},
"height": "14px",
indicator: 'Saving...',
tooltip: 'Click to edit...'
....
[/code]
Thank you so much for all help.
Regards
Jatt
I've been using datatables with great results, and am now using keytable with jedit-plugin to be able to edit the table and saving it.
However my tables are big, with couple of thousand rows, and it takes quite some time to load this. Some of the time has to do with the dataloading and some would be the datatable. I'm wondering why I'm having these performance issues when the datatable is supposed to be quite fast. Is there any settings below which could be an issue, or could I partly load the table etc?
This is how I've set up the datatable:
[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"]]
});
/* ************************************************************************ */
/* MAKE A TABLE EDITABLE */
/* ************************************************************************ */
var keys = new KeyTable({
"table": document.getElementById('userdealsTable'),
"datatable": oTable
});
/* Apply a return key event to each cell in the table */
$('#userdealsTable tbody td').each(function() {
keys.event.action(this, function(nCell) {
/* Block KeyTable from performing any events while jEditable is in edit mode */
keys.block = true;
/* Initialise the Editable instance for this table */
$(nCell).editable(function(sVal) {
/* Submit function (local only) - unblock KeyTable */
keys.block = false;
return sVal;
}, {
"onblur": 'submit',
"onreset": function() {
/* Unblock KeyTable, but only after this 'esc' key event has finished. Otherwise
* it will 'esc' KeyTable as well
*/
setTimeout(function() { keys.block = false; }, 0);
}
});
/* Dispatch click event to go into edit mode - Saf 4 needs a timeout... */
setTimeout(function() { $(nCell).click(); }, 0);
});
});
/* Apply the jEditable handlers to the table */
$('td', oTable.fnGetNodes()).editable('/Affiliation/EditDataTable', {
"callback": function(sValue, y) {
var aPos = oTable.fnGetPosition(this);
oTable.fnUpdate(sValue, aPos[0], aPos[1]);
},
"submitdata": function(value, settings) {
return {
"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition(this)[2]
};
},
"height": "14px",
indicator: 'Saving...',
tooltip: 'Click to edit...'
....
[/code]
Thank you so much for all help.
Regards
Jatt
This discussion has been closed.
Replies
Allan