Responsive and RowGroups how to calculate # of visible columns
Responsive and RowGroups how to calculate # of visible columns
In the below example:
http://live.datatables.net/papabeno/2
I am using the RowGroup plugin along with the responsive plugin. In the RowGroup endRender() function, I am attempting to allocate all but 1 of the columns to 'remark' column. The last column should be a sum of all salaries. At first this works correctly but when you shrink the screen size, the responsive plugin starts to drop columns and the salary sum no longer renders in the correct location.
I am looking for suggestions on how to correctly keep the salary sum in the correct collumn even when responsive is used. If need be, I can use two end render columns, 1 for remarks and 1 for the sum but I would still like to align the salary sum correctly.
Thanks.
Answers
I think you will need to use the
responsive-resize
event to redraw the table, usingdraw()
, to update therowGroup.endRender
tr
element. Note the use ofdraw( false )
to stay on the same page. Also I updated yourpluck()
parameter to use the column number since your data is array based, not object based.http://live.datatables.net/qidorafi/1/edit
Kevin