I have this example:
Code: Select all
<p:dataTable id="example" var="item" value="#{bean}">
<f:facet name="header" style="height:50px;">Details
<p:commandButton id="toggler" type="button" value="" style="float:right; height:20px; width:30px; font-size:10px;" icon="ui-icon-calculator" />
<p:columnToggler datasource="example" trigger="toggler" />
</f:facet>
<p:columnGroup type="header">
<p:row>
<p:column rowspan="2" headerText="Description" />
<p:column colspan="2" headerText="Stock" />
</p:row>
<p:row>
<p:column headerText="Number of Items" />
<p:column headerText="Value" />
</p:row>
</p:columnGroup>
<!-- first column -->
<p:column>
<h:outputText value="#{item.description}" />
</p:column>
<!-- second column, grouped -->
<p:column>
<h:outputText value="#{item.stockNo}" />
</p:column>
<p:column>
<h:outputText value="#{item.stockValue}" />
</p:column>
</p:dataTable>
When the toggler hides e.g. the first column of the first header-row it also hides the first item in the dom's second header row.
So in this example, it also hides the "Number of Items" column. The algorithm doesn't check the 'rowspan="2"' attribute.
I'm using Primefaces 5.3 currently.
Is this a known problem and does anybody knows a fix for this?