Datatable, ajax sorting problem

Datatable, ajax sorting problem

plexus81plexus81 Posts: 2Questions: 0Answers: 0
edited October 2010 in General
Sorting dosn't work in table? Seems like it's processing, but the elements in the table doesn't change.

[code]


$(document).ready(function () {

$('#example').dataTable({
"sDom": "rt",
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"bSort": true,
"sAjaxSource": "/MyOrder/GetMyOrders",
"aaSorting": [[ 4, "desc" ]],
"aoColumns": [
null,
null,
null,
null,
null],
"fnServerData": function (url, data, callback) {
$.ajax({
"url": url,
"data": data,
"success": callback,
"dataType": "json",
"type": "POST",
"cache": false,
"error": function () {
alert("DataTables warning: JSON data from server failed to load or be parsed. " +
"This is most likely to be caused by a JSON formatting error.");
}
});
}
});
[/code]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Sorting when done with server-side processing, is done on the server. So the GetMyOrders script would need to be taking this into account. Is it?

    Allan
This discussion has been closed.