'On DatatableJS server side, how to make a column's order not callback server?

I use datatablejs server-side in my MVC project. When I click to a column it sends the column name to server and I take the column name after all I order the table.

But the problem is in a table I don't want to order a column by server-side. I just want to order this column in front-end. How can I do that?

Here is some code:

table = $(table).DataTable({

    "ajax": {
        "url": postToUrl,
        "type": "POST",
        "datatype": "json",
        "data": data //Veri göndermek istedğinde str ile controllerda çağır,
    },
    "columns": columns, // BURAYA GÖSTERİLECEK KOLONLARI GİR! EKSİK OLAMAZ
    "serverSide": "true",
    "order": [0, "asc"],
    "processing": "true",
    "retreive": "true",
    "fnRowCallback": fnRowCallBack,
    dom: "<'row'<'pt-1 col-sm-6 col-12'l><'pt-1 col-sm-6 col-12'f>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'d-flex justify-content-center justify-content-lg-start col-12 col-lg-5'i><'d-flex justify-content-center justify-content-lg-end col-12 col-lg-7'p><'pt-1 pb-1 col-sm-12 d-flex justify-content-start justify-content-md-center'B>>",
    buttons: [
        'copy', 'csv', 'excel', 'pdf', 'print'
    ],
    "iDisplayLength": 10,
    "columnDefs": columnDefs,
    "oLanguage": {
        "sUrl": '/Content/js/demo/Turkish.json'
    },
    colReorder: true,
    "oSearch": {
        "sSearch": ""
    },
    stateSave: true,
    destroy: true,
    "drawCallback": function(settings) {
        successFun();
    }
});

and I get my table's request from this method:

public ActionResult GetCustomersServerSide()
    {

        //datatable için 
        int start = int.TryParse(Request["start"], out int _start) ? _start : 0;
        int length = int.TryParse(Request["length"], out int _length) ? _length : 0;


        //arama için
        var searchValue = Request["search[value]"];
        //sıralama için
        var order = Request["order[0][column]"];
        string colWantedToOrder = int.TryParse(order, out int _order) ? Request[$"columns[{_order}][data]"] : "";
        var direction = Request["order[0][dir]"];

In my opinion, I can just control the request which came from datatable and return the same table into this DT. But i want to use DT's properties. If I do my opinion, this will be complex.

Note: We can make a column order disable. But I don't want it. I want the column orderable but not with server-side.

Note 2: Datatable's server-side rendering for order a column starts when we click to a column's order icon. So I want this icon to stay in the same place. But not send anything to the server. Just work in front-end.



Solution 1:[1]

I get a link how to solve my problem.

here is the link: Problem Solved here

The solution is: When we get the table's data from the server, we can disable the server side processing temporary.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 FUCKSTACKOVERFLOW