Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2020-10-17 05:36 PM
Hello,
I have been using the WarnigAlert and WarningConfirm functions in my custom objects, Is there LoadingOn and LoadingOff archer custom object functions that can be used? What other Archer custom functions are there?
Note: I have tried writing my own functions to do this:
these 2 function when pasted into the console work, but do not run from within a custom object. Why is this?
Thanks
2020-10-19 08:45 AM
Hi Michael
I don't know what LoadingOn and LoadingOff are; they aren't events in JavasScript/DOM and I haven't seen any reference to those in Archer.
There's currently nothing documented for Archer's client-side functions.
Advisory Consultant
2020-10-19 05:19 PM
There is a DOM element with id loadingmask-1040. It is display: none by default. all the above is doing is removing this display none style attribute (loadingOn) and then placing it back (loadingOff).
I wish to show the native archer loading icon while awaiting an api response. these functions work as expected when pasted in the console, and called. But when called from within a custom object, they do not work. Not sure why this was the case
Thanks for the help anyways
2020-10-20 11:48 AM
Ah, I understand now.
Archer creates that spinner and destroys it when it's no longer needed.
You can use Archer's other spinner like so:
Initialize:
animationOptions = ArcherTech.UI.GenericContent.GetInstance().get_loadingAnimationOptions();
To display
$('body').loadingAnimation({ title: "title of spinner", text: "text displayed in spinner", image: animationOptions.image });
To remove:
$.fn.loadingAnimation.remove();
Advisory Consultant
2020-10-20 02:15 PM
Worked Like a charm! Thanks David,
I am noticing some strange behavior however, I am noticing some strange behavior with the WarningConfirm function now, it is running the function I pass as the second argument regardless if the user click OK or Cancel.
copyFunction runs regardless of the user input
Thanks In advance again
2020-10-20 02:26 PM
Sweet
For the WarningConfirm() function, it needs to look like this:
var userConfirmed=function(arg){
if(arg) {
// User clicked 'OK'
}
};
WarningConfirm(msg,userConfirmed,title);
Advisory Consultant