如果在Apex-Repeat中选中了特定的复选框,是否可以在SetImeout中禁用其他复选框?
我有一个可以更新多个值的程序,我想在单击Spesific复选框后2秒钟给Settimeout 2秒。当Settimeout加载Apex-Repeat中的其他复选框时,将禁用SettiMeout在其他复选框上时,将再次启用。
我尝试了很多方法,但仍然没有弄清楚。是否可以?
这是我的代码:
<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);
});
});
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);
});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论