I have got a JSON object that I receive from a php file,the JSON object is created as per the specified format.But I get the the warning UNRESPONSIVE SCRIPT.I have got over 50,000 records and it loads every record instead of the 20 records I specified in the iDisplayLength parameter. I know Im doing something wrong,please help.
The JSON Object :
{
"iTotalRecords":"52000",
"iTotalDisplayRecords":"52000",
"sEcho":0,
"aaData":[
{"itemID":"13901","itemName":"Item 1","itemModel":"Model 1","Price":"20"},
{"itemID":"13902","itemName":"Item 2","itemModel":"Model 2","Price":"30"},
{"itemID":"13903","itemName":"Item 3","itemModel":"Model 3","Price":"50"},
{"itemID":"13904","itemName":"Item 4","itemModel":"Model 4","Price":"60"},
{"itemID":"13905","itemName":"Item 5","itemModel":"Model 5","Price":"20"},
................
]
}
$(document).ready( function () {
$('#tbItems').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "getItems",
"aoColumns": [
{ "sTitle": "itemID", "mDataProp": "itemID" },
{ "sTitle": "itemName", "mDataProp": "itemName" },
{ "sTitle": "itemModel", "mDataProp": "itemModel" },
{ "sTitle": "itemPrice", "mDataProp": "itemPrice" }
],
"sPaginationType": "full_numbers",
"bLengthChange": false,
"iDisplayLength": 20,
"aaSorting": [[ 1, "asc" ]]
});
});