Reputation: 768
I am using Datatables and the table tools plugin. I can have the selected row returned as a javascript variable. With that variable I want to get the value of a specific cell in each row. I am not sure at all how to do this though. This is basically what I have
var rowData = TableTools.fnGetInstance( 'tableID' ).fnGetSelected();
And what I want to do is something like rowData.children('td'), that doesn't work, but something to that effect.
Upvotes: 1
Views: 2794
Reputation:
var cellValue = $("#tableID").dataTable().fnGetData(rowData, colIndex);
Where colIndex is whatever column you want to get the value of (this includes hidden cells).
If you don't care about hidden cells, you could also do:
var cellValue = $(rowData).children("td")...
Upvotes: 2