Retrieve table name from dt parameter
Retrieve table name from dt parameter
![itajackass](https://secure.gravatar.com/avatar/8734d72a9b7f5f8631f74ac3731cbdee/?default=https%3A%2F%2Fvanillicon.com%2F8734d72a9b7f5f8631f74ac3731cbdee_200.png&rating=g&size=120)
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