i have a program that can update multiple value, i wanted to give settimeout 2 second after click on spesific checkbox. when settimeout is loading the other checkbox in apex-repeat is disabled and when the settimeout is over the other checkbox will be enable again.
i tried so many ways and still not figure it out. is it possible?
this is my code now:
<apex:repeat value="{!dataSalesPlan}" var="i">
<apex:inputCheckbox styleClass="checkOpex{!i.spd.ID} checkOpex {!i.spd.ID}" value="
{!i.opex}">
<apex:actionSupport event="onchange" action="{!updateOpex}" reRender="">
<apex:param name="salesPlanIndex" value="{!i.index}" assignTo="{!salesPlanIndex}"/>
</apex:actionSupport>
</apex:inputCheckbox>
</apex:repeat>
Javascript:
<script type="text/javascript">
document.documentElement.style.setProperty('--screen-width', (screen.width - 120)+'px');
j$ = jQuery.noConflict();
j$(document).ready(function() {
j$(document).on('change', '.checkOpex', function(e) {
var self = $(this);
$(this).prop('disabled', true);
setTimeout(function() {
$(self).removeAttr('disabled');
alert("Succesfully Set Data");
}, 2000);
});
});