Proper way to add Datatable Toggler

Post Reply
smore
Posts: 13
Joined: 24 Mar 2015, 22:13

04 Sep 2018, 17:19

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 ?

huseyinT
Posts: 118
Joined: 27 Mar 2016, 13:05

05 Sep 2018, 07:38

You could remove style="float=right" and it will fix.

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

Post Reply

Return to “Paradise - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests