Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Archer Custom Object Loading

MichaelCanini
Contributor III

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:

 

  var loadingOn = function () {
    var jq = $("#loadmask-1040");
    console.warn("asdasd");
    console.warn({ jq });

    var style_arr = jq.attr("style").split(";");
    style_arr.splice(41);
    jq.attr("style"style_arr.join(";"));
  };
  var loadingOff = function () {
    var jq = $("#loadmask-1040");
    var style_arr = jq.attr("style").split(";");
    style_arr.splice(41" display: none");
    jq.attr("style"style_arr.join(";"));
  };

 

these 2 function when pasted into the console work, but do not run from within a custom object.  Why is this?

 

Thanks

5 REPLIES 5

DavidPetty
Archer Employee
Archer Employee

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

MichaelCanini
Contributor III

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

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

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.  

 

  function copyButtonPress() {
    console.groupCollapsed("copyButtonPress");
    let title = "Warning";
    let msg =
      'Please click "OK" if you want to Copy this record. Else click "Cancel".';
    WarningConfirm(msgcopyFunctiontitle);
    console.groupEnd();

 

copyFunction runs regardless of the user input

 

Thanks In advance again

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