Retrieve table name from dt parameter
Retrieve table name from dt parameter
itajackass
Posts: 162Questions: 48Answers: 3
I've a button inside datatables.
My datatables is generated dinamically with javascript like:
for ( k=0; k<10; k++) {
var table = "tab_" + k;
$("#content").append('<table class="display table table-bordered table-striped table-hover" id="'+table+'" style="width:100%;"></table>');
$('#'+table).DataTable( {
...
,
buttons: [
{
text: 'Retrieve datatable id',
action: function ( e, dt, node, config ) {
// do something with table id
console.log($(dt));
}
}
]
});
}
I've a button to do some action base on table id... but i don't find attribute inside "dt" to di it..
This discussion has been closed.
Replies
Hi @itajackass ,
This is similar to this thread here. Take a look at the example at the end of that thread, that should do it for you too,
Cheers,
Colin