improve the speed of initiating a table my table

improve the speed of initiating a table my table

guypaskarguypaskar Posts: 2Questions: 1Answers: 0

Hi ,

I have large datatable in my app. (can be 500 - 20,000 but let's talk about 500 rows).
The way I build it today is simply build the whole table html append it to the dom and then call .dataTable(tableConfig); where table config is:
"{
"iDisplayLength": 12,
"aLengthMenu": [
[
12,
24,
36,
-1
],
[
12,
24,
36,
"All"
]
],
"bSort": true,
"sDom": "T<\"clear\">lfrtip",
"oTableTools": {
"sSwfPath": "../dataTables/extras/TableTools/media/copy_csv_xls_pdf.swf",
"aButtons": [
"copy",
{
"sExtends": "csv",
"sTitle": "Electrical parmeters"
},
{
"sExtends": "pdf",
"sTitle": "Electrical parmeters"
},
{
"sExtends": "xls",
"sTitle": "Electrical parmeters"
},
{
"sExtends": "print",
"sTitle": "Electrical parmeters"
}
]
},
"columnDefs": {
"type": "numeric-comma"
}
}

Now, one other important feature that I have is editable cells which I enable inside the html like that
<td><input class="form-control edit-line" type="text" data-stream-idx="' + ii + '" value="' + val + '" onchange=\"editChanged(event);\"></td>

The loading time of this table is really bad and not acceptable. I was reading about it and it looked like a good idea to use deferRendering , So I changed the way I build the html of the table such that I only build the thead section and instead of building the body I have built an array of array and added it to the config as "aaData"
also added to config "bProcessing": true ,"bDeferRender":true - The result was the same as before , the table was drawn but very slow.

Am I doing something wrong? why does the loading/init speed stays the same?

Thanks,
Guy

Answers

This discussion has been closed.