Page 1 of 1

Proper way to add Datatable Toggler

Posted: 04 Sep 2018, 17:19
by smore
in sample.xhtml of paradise I add a toggler:

Code: Select all

<p:dataTable id="cars" var="car" value="#{dtBasicView.cars}" reflow="false" selectionMode="single" selection="#{dtSelectionView.selectedCar}" rowKey="#{car.id}">
                                <f:facet name="header">
                                    DataTable
                                    <p:commandButton id="toggler" type="button" value="Columns" style="float:right" icon="ui-icon-calculator" />
                                    <p:columnToggler datasource="cars" trigger="toggler" />
                                </f:facet>
                                <p:column headerText="Id" sortBy="#{car.id}">
                                    <h:outputText value="#{car.id}" />
                                </p:column>
And this is the result:
https://ibb.co/fZbSEe

What is the proper way to add the column toggler ?

Re: Proper way to add Datatable Toggler

Posted: 05 Sep 2018, 07:38
by huseyinT
You could remove style="float=right" and it will fix.

You could give style p:commandButton according to your needs.