You need to sign in to do that
Don't have an account?
SFDC Guest
Lightning window timesetOut while displaying modal
Please let me know how to set timeout in lightning component controller. Thanks in advance.
Lightning javascript controller: openModel: function(component, event, helper) { var selectedItem = event.currentTarget; var index = selectedItem.dataset.record; var action = component.get("c.getRec"); action.setParams({"caseValue": index}); action.setCallback(this, function(response) { var state = response.getState(); //alert(' data is:' + JSON.stringify(response.getReturnValue())); if (state === "SUCCESS") { component.set("v.recObj", response.getReturnValue()); } else { console.log("Failed with state: " + state); } }); $A.enqueueAction(action); // Set isModalOpen attribute to true component.set("v.isModalOpen", true); //find modal using aura id var modal = component.find("myModal"); var modalBackdrop = component.find("myModal-Back"); // Now add and remove class $A.util.addClass(modal, 'slds-fade-in-open'); $A.util.addClass(modalBackdrop, 'slds-fade-in-open'); }
Can you try checking the below link that has an implementation of callout that you could use for your scenario?
>> https://www.mhamzas.com/blog/2020/04/15/settimeout-in-lightning-component-aura/
Below is the code I found in the above link for quick reference:
>> https://salesforce.stackexchange.com/questions/149870/how-to-add-waiting-time-in-lightning-component-controller
I hope this helps and in case if this comes handy can you please choose this as the best answer so that it can be used by others in the future.
Regards,
Anutej