Order array with empty direction
Order array with empty direction
mdellanave83
Posts: 36Questions: 3Answers: 0
Hi,
I noticed that the order array can contains an empty direction so the columns seems to be not ordered after 3 clicks, does it make sense?
To me, if the array contain something, than it should always have the direction populated with asc or desc (at the same time the user click should toggle between those 2 states)
What do you think?
Is there some options to rule this behavior?
Replies
It does and that is intentional. That is the "neutral order" state. Having it in the array allows it to be part of the click sequence. Say for example you wanted to do
asc
,neutral
,desc
as the click order. I don't know why one would, but this allows it to be possible!See
columns.orderSequence
for more details, including how to disable the neutral ordering if you don't want it.Allan
Perfect, thank you @allan
I found also this related https://datatables.net/forums/discussion/78749/ordersequence-option-globally-for-the-table-not-for-columns