I could use a little insight on .rows('.selected').data(). I need to access cell data from a selected row but I can not even get past to accessing the TR data. My following scripts returns [object Object] in my alert, when I should see the data in the selected rows. I exhausted all my resources trying to solve this. Any help would be greatly appreciated .
var mfgTable;
$(document).ready( function () {
mfgTable = $( "#ManufacturerTable" ).DataTable({
ordering: false,
iDisplayLength: 20,
oLanguage: {sSearch: "Table Search: "},
processing: true,
serverSide: true,
ajax: {url: "ssp_getManufacturersData.php",}
},
columns: [
{ orderable: false,
className: 'select-checkbox',
targets: 0,
data: null,
defaultContent: '',
width: '10px',
},
{ data: "vendor_number"},
{ data: "manufacturer_name" },
{ data: "manufacturer_address"},
{ data: "manufacturer_city" },
{ data: "manufacturer_state" },
{ data: "manufacturer_zipcode" },
{ data: "manufacturer_type" },
{ data: "manufacturer_status" },
],
select: {
style: 'os',
selector: 'td:first-child'
},
});
} );
// Function called from button after row is checked
function getTableRowData( ){
var tableData = mfgTable.rows('.selected').data();
var tempData;
$.each(tableData , function(i, val) {
tempData= tableData [i];
alert(tempData);
});