Order column on load

Order column on load

volumesvolumes 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

Sign In or Register to comment.