2

I'm working with primefaces 5.0 and i created one Primefaces:Datatable with Column:ColumnToggle but i need define initial columns to display. How to hide some columns initially? With property toggleable="false" i define that column not toggleable. Don't exist one property that defines initial columns?

<p:datatable ...>
    <f:facet name="header">
          <p:commandButton id="toggler" type="button" value="Data" icon="ui-icon-calculator" />
          <p:columnToggler datasource="itemsDT" trigger="toggler" />
    </f:facet>
    ...
</p:datatable>
Marin
  • 1,010
  • 1
  • 10
  • 37

1 Answers1

1

How to hide some columns initially?

use visible="false".

Example

<p:column filterBy="#{vo.faxNo}" headerText="Fax No." sortBy="#{vo.faxNo}"
                    filterStyle="width: 90%" style="width: 130px;" visible="false" >
                    <h:outputText value="#{vo.faxNo}" />
                </p:column>
AI.
  • 934
  • 2
  • 14
  • 30
  • Better to vote for the question being a duplicate of the link in the comment. Now we get to 'similar' Q/A entries – Kukeltje Nov 11 '16 at 09:14