Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35272

Sorting breaks when trying to use columns.orderData with order

$
0
0

JS Fiddle

In my datatable, I have two columns which I want to do a multi-column default sort. However, the columns I want to sort by are for display purposes only, the actual values I want to sort by are in hidden columns. It worked in 1.9, but I'm trying to upgrade to 1.10 and change all the hungarian notation to camelcase. The code below (also in JS Fiddle link above) doesn't work... the columns aren't sorted and trying to click the header to sort does nothing:

$(document).ready(function () {
    var table = $('#example').DataTable({
        order: [
            [3, 'asc'],
            [1, 'asc']
        ],
        columns: [
        null, {
            orderData: 2
        }, {
            visible: false
        }, {
            orderData: 4
        }, {
            visible: false
        }]
    });
});

If I change the orderData to iDataSort, everything works as expected, but I'm trying to get away from the hungarian notation.

If I change the order to use columns besides the columns that contain orderData... that also works, but then I don't get the columns being sorted the way I want.

Any ideas? Is this a bug or is there a new way to do this?


Viewing all articles
Browse latest Browse all 35272

Trending Articles