¿Can I set columns, title, message, image dinamically?

¿Can I set columns, title, message, image dinamically?

mash180mash180 Posts: 3Questions: 2Answers: 0

Cant this buttons option be set or taking from table data attribute?

<table id="MyTable" data-title="MyTitle" data-columns="[1,2,3]" data-image="myimagesource,png" data-message="Nice table created with datatables.js"></table>

$('#MyTable').DataTable({

buttons: [{
    extend      : 'print',
    text        : 'Print',
    title       : $('#MyTable').data('title'),
    message     : $('#MyTable').data('message'),
    exportOptions: {
        columns: $('#MyTable').data('columns')
    },
    customize: function ( win ) {
        $(win.document.body).prepend($('#MyTable').data('image'));
    }
}]

});

This discussion has been closed.