Modify cell in a hidden col (1.10.4)
Modify cell in a hidden col (1.10.4)
How can I modify a cell in a hidden column?
cell().data() does not allow to set a data to invisible column. It throws an error
TypeError: cell[0] is undefined
_fnSetCellData( ctx[0], cell[0].row, cell[0].column, data );
Code sample:
var objTable = $('#equipment').DataTable();
objTable.column( 5).visible( false);
objTable.cell( '#eq0 .eqDays').data( 11);
Moreover I do not see any other Api method which would allow to modify hidden column cell.
Thank you
This question has accepted answers - jump to:
Answers
Hi,
Can you show me the HTML you are trying to modify. Specifically what is
#eq0 .eqDays
meant to select (keeping in mind that is a select applied to the cells and should select a cell).Perhaps you might want to use a row and column combination selector instead - like in this example: http://live.datatables.net/pawijose/1/edit .
The error you are seeing suggests that no cells were selected.
Allan
Thank you. #eq0 is row id and .eqDays is column class. Exactly as you defined in th sample.
So As I see this works:
but this doesn't:
and just by looking to the API docs
cell()
definition:I was expecting that columnSelector can also be '.eqDays'. I would say it is a bit not clear in the docs that columnSelector must be a column number.
Thank you!
Won't work unless the header for the column has that class applied to it - in which case it will. The
column-selector
operates on the header cell for the column.Allan
Makes sense. Thanks a lot