aoColumnDefs bSortable by class name not work

aoColumnDefs bSortable by class name not work

andompandomp Posts: 5Questions: 1Answers: 0

Hi all!
I've a problem with aoColumnDefs bSortable,
i have a table with the class "nosort" in the <TH>,

<table id="table" class="table>
  <thead>
  <tr>
    <th class="nosort"></th>
    <th class="nosort></th>
    <th class="nosort></th>
    <th></th>
  </tr>
</thead>
  <tbody>
    <tr>
    ....
    </tr>
  </tbody>
</table>

with

        table = $('.lte-table').DataTable({
               aoColumnDefs: [{
                 bSortable: false,
                 aTargets: 'nosort'
             }]
        });

The sort function in all the column that have "nosort" class in the <TH> are disable, and works perfectly,
except the first column...

How ca i fix it?

Please help me

Best regards

Replies

  • luisrortegaluisrortega Posts: 79Questions: 6Answers: 1

    try

    aTargets:["nosort"]

  • andompandomp Posts: 5Questions: 1Answers: 0

    Thanks to this post
    I fixed it adding order: [],

    table = $('.lte-table').DataTable({
           order: [],
           aoColumnDefs: [{
             bSortable: false,
             aTargets: 'nosort'
         }]
    });
    
    
This discussion has been closed.