Is there an easy way to select/deselect all checkboxes in a p:selectManyCheckbox using JavaScript?
I've got it working right now but my method seems overly complicated for something I feel should be simple from PrimeFaces
Code below:
The select boolean checkbox:
<p:selectManyCheckbox id="multiSelectPerformanceCb"
widgetVar="multiSelectPerformanceCb"
value="#{cc.attributes.filter.selectedCriteria}">
<f:selectItems value="#{cc.attributes.filter.performanceCriteria}"
var="criteria" itemLabel="#{criteria.text}"
itemValue="#{criteria.description}" />
</p:selectManyCheckbox>
A method that is ran on a button click:
function performanceSliderBooleanClick()
//Uncheck the inputs
PF('multiSelectPerformanceCb').inputs.each(function(){
this.checked = false;
});
//Remove ui-state-active from the outputs
PF('multiSelectPerformanceCb').outputs.each(function(){
$(this).removeClass('ui-state-active');
});
}
Aucun commentaire:
Enregistrer un commentaire