Capture content of a cell of the fixed column (DataTables 1.9 with FixedColumn)
Capture content of a cell of the fixed column (DataTables 1.9 with FixedColumn)
Hello,
I have this question (always for DataTables 1.9 with FixedColumns; first column is fixed):
How to catch the content and the id of the td of the fixed column when I click on the whole row (or even on that td itself) ?
I already gave ids (like this: idCell_......) to the tds when I create the table.
I am using this:
$('#tableList').on( 'click', 'tbody tr', function () {
idString=this.id;
realIdString= idString.substring(idString.indexOf('_')+1); //this is the ID I need
key=($(this).find('td:eq(1)').text()); // this is the content I need
This way I can get both the id and content of the first td of the fixed column ( when I click on the row on the first td).
The problem is that if I click on a td of a not fixed column I get the content of the first td of the not fixed column.
In other word I can get the id and content of a cell of the fixed column only if I click on the row on the fixed column. If I move to the not fixed columns, same row, and click on a cell I get the content of the first td of the not fixed column.
I hope it is clear enough.
Thankx,
A