Can hidden columns be populated with .row.add() ?
Can hidden columns be populated with .row.add() ?
Hi,
While using .row.add() to add row to a given datatables.. does it populate also hidden columns?
*** If the following row is added:
fooTable.row.add( [
'101',
'Product 101',
200,
'flagYes', // this column is hidden in the datatables definition for fooTable ( { "bVisible": false, "aTargets": [ 3 ] } )
'300'
] ).draw();
*** A later inspection by:
for(i=0;i<5;i++){
alert( 'i=' + i + ' value=' + fooTable.cell(myrow,i).data());
}
will show that while visible columns are properly populated, hidden column value is"undefined".
Is there any way to add new rows loading also data into the hidden columns?
This question has an accepted answers - jump to answer
Answers
Yes it should! Can you link me to a test case showing the issue? That really should work! Another check to make would be
row( myrow ).data()
. It is possiblecell().data()
has a bug in it...Thanks,
Allan
Thanks for answering, it really helps to know that it has to work.
I don't know what was wrong but after replicating in jsfiddle it works both in the application and in fiddle. I guess there was some mismatched quotes or something like that.
Just in case it helps somebody else, I attach the fiddle:
http://jsfiddle.net/f6fM8/2/
Good to hear it works now!
Allan