Is there a way to remove the select all check box on the header of the p:datatable.
I need check box on the individual row but not on the header.
This works very well :
.ui-chkbox.ui-chkbox-all.ui-widget {
display:none !important;
}
I managed to do this by using p:columnGroup for specifying headers.
<p:dataTable id="selectByPotentialTable" var="replacementByPotential"
widgetVar="selectByPotentialTable"
value="#{kmSelectByPotentialBean.allReplacementPrintersViewModel}"
selection="#{kmSelectByPotentialBean.selectedByPotentialReplacement}">
<p:columnGroup type="header">
<p:row>
<p:column/>
<p:column headerText="Printer Model"/>
</p:row>
</p:columnGroup>
<p:column selectionMode="multiple" style="width:2%;text-align:center"/>
<p:column>
#{replacementByPotential.name}
</p:column>
</p:dataTable>
If you change your mind and you want the selectAll checkbox to be displayed, you need to change
<p:columnGroup type="header">
<p:row>
<p:column/>
<p:column headerText="Printer Model"/>
</p:row>
</p:columnGroup>
to
<p:columnGroup type="header">
<p:row>
<p:column selectionMode="multiple" style="width:2%;text-align:center"/>
<p:column headerText="Printer Model"/>
</p:row>
</p:columnGroup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With