function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
lakshmi25lakshmi25 

in pageblock table header check box is diable how to disable under checkboxes please sample code

in pageblock table header check box is diable how to disable under checkboxes

nickwick76nickwick76

Sorry, don't get the problem. 

Can you be more detailed please?

 

// Niklas

MoUsmanMoUsman

Using jQuery you can solve your issue as shown below, here if your header checkbox is disabled then all value checkboxes will be disabled otherwise enabled.

 

<apex:page>

 <apex:includeScript value=”{!$Resource.jquery171min}” />

<apex:pageblock >  

                         <apex:pageBlockTable value=”{!listOfObject }” var=”e”>

                             <apex:column width="2%">

                                 <apex:facet name="header">

                                     <apex:inputCheckbox id="selectall"/>

                                 </apex:facet>

                                 <apex:inputCheckbox id="checkBoxId" styleClass=”case”/>

                             </apex:column>

                         </apex:pageBlockTable>

</apex:pageblock > 

<Script>

$(function(){

if($("input:checked")){

                                $('.case').attr('disabled', true);

                }else{

               $('.case'). removeAttr ('disabled');

                }

});

</Script>

</apex:page>

 

please mark it solved.

Thanks

MohammadUsman