I have a jquery datatable for whom I've set a default sort column like this:
$('#datatable-responsive').DataTable({
"oLanguage": {
sProcessing: "<img src='/images/gears.svg'>"
},
order: ['3', 'desc'],
Please note this part:
order: ['3', 'desc'],
Now the default sort column should be the 4th one (0,1,2 => 3 (4th))
When I first load a page I get a correct result for the following in my C# action:
var sortColumnDir = Request["order[0][dir]"];
Looks good first time, sorcolumndir is "desc" as required...
Now the second time when I click table's head to sort the column in ascending order... I get a null as result in this line:
var sortColumnDir = Request["order[0][dir]"]; // this is now null for some reason ?
When I switch between pages, without clicking to try to change the order of column [3] to ascending order, it's always good... But when I try to change it into ascending order it throws me exception and returns null :(
Any ideas guys why this might happen ? What am I doing wrong here?
P.S. Guys I need to have this column [3] always in descending order as default if user hasn't clicked to sort it otherwise, or some other column.