Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82220

Sorting via javascript only working the first time

$
0
0

Hello,

I am using version 1.10.16 of datatables and have a static table with the following initialiser:

        var mappingTable = $('#importMappings').DataTable({
            "paging": false,
            "info": false,
            "searching": false, 
            "ordering": true
        });

The table renders fine with no console errors. Below is my multi column sort:

mappingTable.order([[4, 'desc'], [0, 'asc']]).draw();

This sort order is applied when a drop down in a row is changed. This changes switches the value in the column relating to the [4, 'desc'] to either a 1 or 0 in a <td> programmatically for the same row. The ordering after the data value switch works the first time but if I then programmatically switch the 1 or 0 back again causing the reorder to re-fire the sorting doesn't work at all. There are no console errors. I have tried draw() with various parameters and the effect is the same. Am I missing something?

Thanks in advance.


Viewing all articles
Browse latest Browse all 82220

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>