in this way I fetch the data
$(document).ready(function() {
$('#example').DataTable( {
"ajax": {
"method":"POST",
"url":"exampleurl.php"
},
"columns":[
{"data":"title"},
{"data":"description"},
{"defaultContent": "<button id='show-info' data-toggle='modal' data-target='#show-modal' class='btn btn-primary'>show</button>"}
]
} );
$('#example tbody').on( 'click', 'button', function () {
console.log( table.row( this ).data() );
});
});
I have seen answers where they propose to use this
table.row( this ).data()
but not work for me