ordering does not work

ordering does not work

89leon89leon Posts: 2Questions: 1Answers: 0

table = $('#didsTable').DataTable({

    "serverSide": true,
    "processing": true,
    "paging": true,
    "pageLength": 50,
    "order": [[1, 'asc']],
    "columns": [
         { "defaultContent": " " },
       { "data": "Counter" },
       { "data": "AccountName"},
       { "data": "UserName" },
       { "data": "Did" },
       { "data": "CountryName" },
       { "data": "DidRemarks" },
       { "data": "DateTime" },
       { "data": "Dispatcher" },
       { "data": "DidStatusName" },
       { "data": "DidPremiumClassLevelTypeName" },
       { "data": "DidProviderName" },

       { "defaultContent": " " },
       { "data": "UserDidId" }],
    "autoWidth": false,
    "sDom": '<"top"i>rt<"bottom"lp><"clear">',
    "columnDefs": [
         {  "targets": 0, "sTitle": "<input type='checkbox' id='selectAll'></input>", "orderable": false, "render": function (data, type, full) { return '<input type="checkbox" id=>'}},           
         { "width": "3%", "targets": 1},
         { "width": "10%", "targets": 2 },
         { "width": "10%", "targets": 3 },
         { "width": "8%", "targets": 4 ,"class":"didNumber"},
         { "width": "10%", "targets": 5 },
         { "width": "8%", "targets": 6,"class":"didRemarks"},
         { "width": "8%", "targets": 7 },
         { "width": "8%", "targets": 8 },
         { "width": "10%", "targets": 9 },
         { "width": "10%", "targets": 10 },
         { "width": "5%", "targets": 11 },
         { "width": "8%", "targets": 12, "mData": null, "mRender": function (data, type, full) {
           return $("<div />").append($("<button class='btn btn-neutral edit'>עריכה</button>")).html();
}},

         { "targets": 13, "class": "hidden userDidId" }],
              "createdRow": function (row, data, index) {
               if (data.AccountName === "") {
                $('td', row).eq(2).addClass("noAccount");
                if(data.AccountName === "" && data.UserName=== "")
                {
                      $('td', row).eq(2).text("Unassigned");   
                }

        }
    },
});

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    You've got server-side processing enabled. Does your server-side script correctly implement server-side processing? It is that script which will do the ordering if you have server-side processing enabled.

    Allan

  • 89leon89leon Posts: 2Questions: 1Answers: 0

    i guess not , thanks ;)

This discussion has been closed.