We have a DataTables plugin table with lots of jQuery manipulation built on top of it.
We have an 'Insert' row in the footer and would like all of our code to be applied to cells in that row in the same way as cells in the rest of the table. For example, when user clicks a '.date' cell, it turns into a datepicker, etc.
When running the jQuery, it's necessary to set the selected cell (with DataTables functions) so that the plugin knows which cell we're dealing with (and renders its values properly the next time we 'draw' the plugin).
We do this using the following DataTables commands:
selectedCell = dataTable.cell(element);
cellColumn = selectedCell.index().column;
cellRow = selectedCell.index().row;
aRowData = dataTable.row(cellRow).data();
orderID = aRowData['DT_RowId'];
selectedField = aFields[cellColumn];
var selectedCellNode = selectedCell.node();
However, DataTables does not recognize these commands when the code is run from a table tfooter td cell. Get the following error:
"Uncaught TypeError: Cannot read property 'column' of undefined"
I tried using table.footer()
, column.footer()
, etc but those just returned html(). I want to actually set this as the 'selected cell' so that I can manipulate it using dataTables functions, as I do for all others.
Is this possible?
Note: I've already posted on DataTables forum but did not receive any answers. I hope StackOverflow can come to the rescue again :-)
Thank you very much.