Sorting table by last column not working

Sorting table by last column not working

iraxirax Posts: 4Questions: 2Answers: 0

Hi All,

I want to sort my table by the last column, and based on the reference, I have code that does:

$(document).ready(function() {
    $('#oneTable').DataTable({
        'order': [0, 'desc']
    });
    $('.generic-table').DataTable({
        'order': [-1, 'desc']
    });
});

My $('#oneTable') sorts correctly by first column, but the sort option on my $('.generic-table') results in an exception:

Uncaught TypeError: Cannot read property 'aDataSort' of undefined

Any idea what I am doing wrong?

Thanks!

Answers

  • iraxirax Posts: 4Questions: 2Answers: 0

    Wanted to add - the sort works fine if I also sort the second table by the a +ve column number.

This discussion has been closed.