var table = $('#example').DataTable();
$('#example tbody').on( 'click', 'tr', function () {
console.log( table.row( this ).data() );
} );
var table = $('#example').DataTable();
$(document).on( 'click', '#FilterTable tbody tr', function () {
$(this).toggleClass('selected');
var ids = $.map(tableObject.rows('.selected').data(), function (item) {
return item
});
console.log(ids) // here it will retur array of object
} );
// you can also do this by clicking another method
var table = $('#example').DataTable();
table.rows().data().map((row) => {
// each row is an array where each column is an element in the array
// as a string
}