I use jQuery Datatable
for listing records and add an Action
button (Edit) for editing the record on a modal dialog. If I select a row I can get th
You can use this code to achieve this.
var table;
$(document).ready( function () {
table = $('#example').DataTable();
} );
$('body').on('click', '#btnEdit', function(){
//to get currently clicked row object
var row = $(this).parents('tr')[0];
//for row data
console.log( table.row( row ).data() );
});
It will return row data as a string array.
Live Demo Here
Use the browser console to see the results.