Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Jan 08, 2009 12:14
open dhtmlx forum
How to print the footer for grid with hidden fields

Hi,
I have a grid with 28 columns. 19 columns are set to be hidden.

Following are the footers attached for that grid:
sgrid.attachFooter("Totals,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,{#stat_total},,,{#stat_total},,,{#stat_total},,,{#stat_total},,,{#stat_total},,,{#stat_total},,,{#stat_total},,<div id='nr_pjTotal'></div>",["text-align:right;"]);
sgrid.attachFooter("Grand Total,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,{#stat_total}",["text-align:right;"]);

When I use printView, the grid shows up fine on pre-print view. But all footers are distorted on pre-print view - e.g. no footer columns are hidden as they were intended to be hidden.

Please advise!
Thanks.
Answer posted by Support on Jan 09, 2009 08:39
Normally footer renders correctly with hidden columns or without them, but in your case you have a lot of colspans in footer, while its not a problem, grid has limitation - hidden columns must not break colspan ( hidden column must affect all columns included in colspan ,  scenario when part of colspan hidden and part is not hidden may and will cause issues ) 
Answer posted on Jan 15, 2009 10:24
We have colspans in footer and we are hiding the columns related to the spanned footer columns. I understand that this is a know limitation. But can you guys suggest any work around or change in printView code which might help to fix this issue in my application.

Thanks.
Answer posted by Support on Jan 16, 2009 04:31
There is no easy way to achieve such functionality. 
Are you have just some column which may be hidden or full structure can be customized by user? In first case, it possible to define columns in header not as native colspan, but as separate columns, styled in such way that they look as a single row ( with such approach there will be no colspan-hidden conflict and grid will look correctly in printView )