how to pass a variable to aaSorting AND how to check aaSorting
how to pass a variable to aaSorting AND how to check aaSorting
sherry_xuehua
Posts: 1Questions: 1Answers: 0
I want to get a list from ajax and assign this value to aaSorting. Like
var templateSortOrder = [];
$.ajax({
type: "GET",
url: getSortOrderUrl,
dataType: 'json',
success: function (result) {
templateSortOrder = result;
}
});
console.log(templateSortOrder); // is [[2,'asc'], [3,'desc']]
var table = $('#reportTable').DataTable({
...
"aaSorting": templateSortOrder,
...
});
It doesn't work :(
This discussion has been closed.