ColumnToggler with ColumnGroups

UI Components for JSF
Post Reply
RomanB
Posts: 1
Joined: 04 Nov 2015, 12:50

04 Nov 2015, 13:03

It seems there's a problem with the ColumnToggler in combination with ColumnGroups.

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>
So the header contains two rows in the DOM.
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?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

04 Nov 2015, 14:38

Groups are not supported by toggler.

Kanakdas
Posts: 6
Joined: 06 May 2020, 14:19

07 May 2020, 02:19

I also wanted columnToggler with columnGroup header, also columns under one header need to be varying in width. Any updates or workarounds available?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 49 guests