Loading indicator
Loading Indicator Options
affectButton Function
affectButton FunctionExample of customizing affectButton
affectButtonconst myCustomAffectButton = (loadingIndicator, loadingIndicatorActions, toState) => {
if (isUndefinedOrNull(loadingIndicator.requester.requesterOptions.okBtn)) {
return;
}
// Customize button behavior here based on toState
switch (toState) {
case LoadingState.NOT_LOADING:
// Enable the button and restore original content
loadingIndicator.requester.requesterOptions.okBtn.prop("disabled", false);
loadingIndicator.requester.requesterOptions.okBtn.html("Submit");
break;
case LoadingState.LOADING:
// Disable the button and set a custom loading message
loadingIndicator.requester.requesterOptions.okBtn.prop("disabled", true);
loadingIndicator.requester.requesterOptions.okBtn.html("Loading...");
break;
default:
// Handle other states if needed
break;
}
// You can add additional custom logic here as needed
};
const reqEase = new ReqEase(
{
//other options
requester: {
//other options
loading: {
//other options
loadingIndicatorActions: {
affectButton: myCustomAffectButton
}
}
}
}
);Last updated
Was this helpful?