Datatable is not processing just over 12k entries on the client side
Datatable is not processing just over 12k entries on the client side

I am using datatable and got the server returned just over 12k, but it is not getting populated in the client.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Have you read the FAQ about this?
Can you link to the page, as per the forum rules, so we can try to debug it.
Allan
var circuitsTable;
var availableCircuits;
$(document).ready(function() {
document.title = 'Circuit Report';
});
function printFunction ()
{
$("#circuitsTableWrapper").printThis();
}
function processGetCircuitTypesResult(ctypes) {
$.each(ctypes, function(i, ctype) {
$('#circuitTypeId').append($("<option/>", {value: ctype.circuitTypeId, text: ctype.circuitTypeName}));
});
document.body.style.cursor = 'auto';
}
function validateCircuitReportForm() {
return true;
}
function getCircuits() {
if (validateCircuitReportForm()) {
var formVars = $("#circuitReportForm").serialize();
formVars = formVars.substring(0, formVars.indexOf("&circuitsTable_length"));
var uri = "/topo/CircuitReportManageAction.do?method=getCircuits&" + formVars;
$.getJSON(uri, function(data) {processGetCircuitsResult(data);});
}
function processGetCircuitsResult(circuits) {
circuitsTable.fnClearTable();
}
</script>
</head>
<body>
It looks like you are using the legacy fnAddData method inside a loop. That is going to be terrible for performance as it will redraw the table on every loop. I would suggest using the
row.add()
method and then callingdraw()
once your loop has finished.Allan
p.s. the guide for highlighting code is linked at the bottom of the reply box
Thank you, so much. It worked.