If ordering is true what is the default order if no "order" option is specified
If ordering is true what is the default order if no "order" option is specified
kevins1966
Posts: 7Questions: 5Answers: 0
Hello,
Before setting up my DataTable, I order the data in the default order I want.
With 'ordering: false' this data is displayed in that order however when this is set to true that order is ignored even though there is no 'order' option specified as discussed on the Default ordering (sorting) page of the website.
Anyone got any idea what might be controlling this or how I work it out?
For reference my table is initialised as follows
ordering: false,
orderCellsTop: true,
deferRender: true,
pageLength: 100,
language: {
paginate: {
first: 'First',
previous: 'Previous',
next: 'Next',
last: 'Last'
}
},
layout: {
topStart: 'pageLength',
bottom: 'info',
topEnd: 'paging',
bottomStart: null,
bottomEnd: null,
},
columnDefs: [
{
target: 'modelIdHide',
visible: false,
searchable: false
}
],
Answers
order
is the parameter that controls the DataTable's load ordering state. As the docs note, the default is[[0, 'asc']]
(i.e. ascending ordering on column index 0).Allan