Primefaces - ColumnToggler Size

Asked

Viewed 238 times

1

I have a datatable with a columnToggler, however I would like to remove the fields without increasing the size of the first field. I’m Using Primefaces 6.0.

<p:dataTable id="cars" var="car" value="#{dtBasicView.cars}">
    <f:facet name="header">
        List of Cars

        <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">
        <h:outputText value="#{car.id}" />
    </p:column>

    <p:column headerText="Year">
        <h:outputText value="#{car.year}" />
    </p:column>

    <p:column headerText="Brand">
        <h:outputText value="#{car.brand}" />
    </p:column>

    <p:column headerText="Color">
        <h:outputText value="#{car.color}" />
    </p:column>

    <p:column headerText="Price">
        <h:outputText value="#{car.price}">
            <f:convertNumber type="currency" currencySymbol="$" />
        </h:outputText>
    </p:column>
</p:dataTable>
  • I don’t understand your question, can you be clearer please?

  • @Douglas I select the Toggler and I remove the columns from the datatable. would like not to remove the first column, but when removing the other columns would like the first column not to modify the original width.

  • Have you tried setting fixed sizes for columns using <p:column width=150px> for example ?

  • @hebertrfreitas já fiz sim, mas não da right. when I shoot a column with Toggler it increases the size of other.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.