Order column on load
Order column on load
volumes
Posts: 4Questions: 2Answers: 0
Hi all,
Probably dumb question, but after reading the manual i really cant find the solution for order the column on load.
https://datatables.net/reference/option/order
i use a pre-made example template, my table:
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
and datatables.init.js
$(document).ready(function () {
$("#datatable").DataTable(),
$("#datatable-buttons")
.DataTable({ lengthChange: !1, buttons: ["copy", "excel", "pdf", "colvis"] })
.buttons()
.container()
.appendTo("#datatable-buttons_wrapper .col-md-6:eq(0)");
});
i already tried several ways, but cant do it.
I need to order ASC on column 5.
Thanks in advance for your help.
This question has an accepted answers - jump to answer
Answers
https://datatables.net/reference/option/order
hI RF1234,
That was the link i wrote and where i tried to, but with no results, thats why i asking for help.
If that doesn't work you will have a different issue. Please post a test case as per the forum rules.
What have you tried?
See this example for how to do this:
https://live.datatables.net/ziditezo/1/edit
If this doesn't help then please provide a link to your page or a test case replicating the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
With more research and your help, I managed to solve it.
Thanks again