"orderData": [a, [b, "asc"], [c, "desc"], ...
"orderData": [a, [b, "asc"], [c, "desc"], ...
Question based on https://datatables.net/forums/discussion/21270/orderdata-a-b-asc-c-desc
I have a table with 2 columns. By default it sorted by first column by descending. If I want to sort it by another column, it should be sorted by this column in given direction + by first column by descending. How to do this?
Now I have:
'columns': [
{
'data': 'orderDate'
},
{
'data': 'orderTitle',
'orderData': [1, 0]
}
]
But I think should be smt like this:
'columns': [
{
'data': 'orderDate'
},
{
'data': 'orderTitle',
'orderData': [1, [0, desc]]
}
]
Answers
There is no option for that yet I'm afraid. DataTables does not yet support this ability.
Allan
Hi Alan,
is there any workaround for this, e.g. based on PHP? I also need a functionality like this.
Thanks,
Eberhard
Sorry no. It is not a feature that is supported by DataTables at this time and I don't think there is a workaround. The only option would be to implement it in DataTables.
Allan