Using api in the defaults setting

Using api in the defaults setting

mzardmzard Posts: 11Questions: 4Answers: 0

Link to test case: http://live.datatables.net/xowuhike/1/edit
Description of problem:
I'd like to make the render code in the test case available to all tables, using the default settings, something like this:

$.extend(true, $.fn.dataTable.defaults, {
    columnDefs: [{targets: 'no-sort', orderable: false},
        {targets: '_all', render: function(data, type, row, meta) {
                var api = $('#example').DataTable();
                return type === 'export'? $(api.cell(meta.row, meta.col).node()).attr('data-export') : data;
            }
        }
    ]
});

But there's a reference to the #example table. How can I change that?

Thanks

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.