I have written a web service that returns some data as json. To display this in a table I am using the datatables jquery plugin:
for(var i=0;i<results.length;i++){
myTable.fnAddData( [
"<input name='codeSearched' type='radio' value='"+results[i].ID+"' />",
"<span id='code_"+results[i].ID+"'>"+ results[i].code+"</>",
results[i].description ] ,true);
}
This javascript seems to kill the browser. (20+ seconds on firefox for just a few thousand rows). I have loaded similar amounts of data into a datatables table before orders of magnitude faster by rendering it server side as an html fragment and inserting directly into the dom.
Can you recommend a way to get the best of both worlds? (I.e, call an ajax web service that serves data in an open structured format, but also parse and render quickly?
Thanks for any suggestions