Respecting data order by in datatable
Respecting data order by in datatable
dlusignan
Posts: 4Questions: 2Answers: 0
Hi,
I have a dataset that is previously fetch by date order DESC, but when table shows up the order is ASC. Any idea why the order from the dataset is not respected ? If I use "order": [0, DESC] (0 being the Date column), I can't reorder anymore.
Thank you.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It should be:
It is case sensitive and should be a 2D array.
Allan
Hi Alan, thanks for the answer. Finally, It was an error in the generated code from the server the caused the problem.
Thank you.
aqui não deu, quero colocar a coluna 0 por ordem DESC, mas não da de jeito nenhum
$(function() {
$("#example2").dataTable({
"order": [[0, 'desc']]
});
});
here I did not give, I want to put column 0 in order DESC, but it does not at all
In order to help troubleshoot please provide a link to your page or a test case replicating the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
The issue is likely due to your data but without seeing your data in an example its hard to tell you what the issue is.
Kevin
I managed to fix it, the problem is that I just needed to update the script: "datatables" .js