Datatable, ajax sorting problem
Datatable, ajax sorting problem
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]
[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]
This discussion has been closed.
Replies
Allan