DataTables Slow to load (large table workaround?)
DataTables Slow to load (large table workaround?)
veranopage
Posts: 24Questions: 0Answers: 0
I am loading a cSV file from the jquerycsvtotable mod and the csv file is approx 700KB. I am using IE7 and it refused to load the table, is there any work around to large tables ?
This discussion has been closed.
Replies
"bDeferRender": true
bDeferRender: true
Please note I havent added any addtional code
Thanks to anyone who can help!
[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
DataTables example
@import "../../media/css/demo_page.css";
@import "../../media/css/jquery.dataTables.css";
$(function() {
$('#CSVTable').CSVToTable('data/total115.csv', {
loadingImage: 'res/theme/loading.gif',
startLine: 1,
tableClass: "dataTable",
headers: ['header1', 'header2', 'header3']
}).bind("loadComplete",function() {
"bDeferRender": true
bDeferRender: true
$('#CSVTable').find('TABLE').dataTable({sortList:[[3,0],[9,0]], widgets: ['zebra']});
$("#CSVTable .dataTable tr").each(function(i,row) {
var column = (i>0)?"":" ";
$(this).prepend(column);
});
$("input:checkbox.removeRow").bind("click", function(){
$(this).closest("tr").remove();
});
});
});
DataTables base example
Live example
[/code]
What are the `sortList` and `widgets` initialisation parameter? DataTables doesn't pick them up unless you have plug-ins?
Allan
Thanks guys!
I don't understand what sortList and widgets are in your initialisation and I don't see how you are using deferred rendering. I also don't see how you are adding data to the table - which you would need to do using fnAddData to make use of deferred rendering.
> this is a 2 month long problem !
You only posted it yesterday :-)
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
DataTables example
@import "../../media/css/demo_page.css";
@import "../../media/css/jquery.dataTables.css";
$(function() {
$('#CSVTable').CSVToTable('data/total115.csv', {
loadingImage: 'res/theme/loading.gif',
tableClass: "dataTable",
headers: ['header1', 'header2']
}).bind("loadComplete",function() {
$("#CSVTable .dataTable tr").each(function(i,row) {
var column = (i>0)?"":" ";
$(this).prepend(column);
});
$("input:checkbox.removeRow").bind("click", function(){
$(this).closest("tr").remove()
$('#CSVTable').dataTable( {
"bProcessing": true,
"bDeferRender": true
} );
});
});
});
DataTables base example
Live example
[/code]
Currently doing this with CSV but I imagine there may be other ways. So I am open to that.
1. Write your own
2. Google search reveals a few possibles including http://www.cparker15.com/code/utilities/csv-to-json/
3. Get an elance.com or freelance.com account and get someone to do it for you, probably not more than USD50
Good luck
It would be best if you could do the CSV -> JSON outside the browser as string manipulate is slow in old IE, but so it goes...
Allan