Im trying to order my datatable by first name (first column) and i am only able to do if sorting isnt disabled for the table.
This scenario 100% requires that the table must not be sortable by the user, but does this also mean that i cant apply a default order on the first column?
I have tried this but obviously this alone allows sorting by the user
{
order: [[0, "asc"]]
}
So i then tried this but this doesnt order the first column
{
order: [[0, "asc"]],
bSort: false,
}
So i then tried this but again it did not work
{
bSort: false,
columnDefs: [
{
targets: [0, 1], //first name & last name
orderable: true
},
{
targets: [ 0 ],
orderData: [ 0, 1 ]
},
{
targets: [ 1 ],
orderData: [ 1, 0 ]
}
]
}
I know i can specify ordering for each column but this table is a dynamic table and there is a varying number of columns depending on the user. It could have 3 columns or it could have 15 so this is not applicable to my scenario.
Any help is massively appreciated. Thanks!