DataTables loading is too slow for json data with DT1.9.2
DataTables loading is too slow for json data with DT1.9.2
narender
Posts: 3Questions: 0Answers: 0
Hi Allan, i am using datatables for the python server side where i get the json data to UI and i use the JS for adding the json data to the data tables. this has 5 columns and about 2000 rows, DataTables loading is very slow, how can i decrease the load time i tried using bsortclasess:false and bjqueryUI false. Note here i am adding the rows to the datatable dynamically.
This discussion has been closed.
Replies
With fnAddData? Are you passing the second parameter as false to stop it redrawing every single time?
Please see http://datatables.net/forums/discussion/9719/how-to-ask-for-help and post a link or at least a debug trace of the table so we can offer some help rather than just guessing :-)
Allan
sorry for not copying the basic details earlier.
here is the datatable i had used...
oTable = $('#srchresTable').dataTable( {
//"bLengthChange": false,
"bFilter": true,
"bInfo": true,
"bPaginate":false,
//"sScrollX": "100%",
//"sScrollXInner": "110%",
//"bScrollCollapse": true,
// "iDisplayLength": 25,
// "bProcessing": true,
"bSortClasses": false,
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 6 ] }
],
"oLanguage": {
"sEmptyTable": "No logs added to table yet."
},
"aaSorting": [[ 1, "asc" ]]
});
and i am using following line for adding the row to the datatable dynamically. here the respMesgs is an JSON data having around 2000+ dictionaries. which i am trying to display using datatable.
var rowData=oTable.fnAddData([
dispMsgImg,dispDate,
((respMesgs[message]['msgBodyFormat']=="edifact")?" Edi: ":"")+respMesgs[message]['msgType'],
msgSize.toFixed(3),
beSrchImg+respMesgs[message]['convID'],
((respMesgs[message]['origConvID'].length>2)?beSrchImg:"")+respMesgs[message]['origConvID'],
dispMsg,respMesgs[message]['msgTmStmp']
]);
var oSettings = oTable.fnSettings();
var nTr= oSettings.aoData[rowData[0]].nTr;
nTr.className=msgClass;
allan your help is need here
Note:I am New to datatables and python
2. If you enable scrolling again, then make sure you also use Scroller and deferred rendering:
http://datatables.net/release-datatables/extras/Scroller/index.html
3. If you enable pagination, make sure you enable deferred rendering
See also http://datatables.net/faqs#speed
Allan