Sort case insensitive with ajax source
Sort case insensitive with ajax source
semog1epilif
Posts: 3Questions: 1Answers: 0
I am using the the ajax source strategy to retrieve my data, however when I use this strategy the sorts became case sensitive.
How can I do to make the sorts case insensitive and use the ajax strategy?
Here is a my code:
var table = $('#records').dataTable( {
"iDisplayLength": -1,
"aaSorting": [ ],
"dom": "<'row'r><'table-scrollable't><'row'<'col-md-5 col-sm-12'i><'col-md-7 col-sm-12'>>",
"sAjaxSource": "MyAction.action",
"sAjaxDataProp": "records",
"bDeferRender": true,
"bSortClasses": false,
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.getJSON( sSource, aoData, function (json) {
var a = [];
for ( var i=0, iLen=json.records.length ; i<iLen ; i++ ) {
var row = [];
row.push(json.records[i]['data']);
a.push(row);
}
json.records = a;
fnCallback(json);
});
}
})
This discussion has been closed.
Answers
Never mind, json.records[i]['data'] was an array