Skip to content

Instantly share code, notes, and snippets.

@cgillis-aras
Created July 30, 2019 17:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgillis-aras/ea18abe9c0e94c6e858c544f5d9c077e to your computer and use it in GitHub Desktop.
Save cgillis-aras/ea18abe9c0e94c6e858c544f5d9c077e to your computer and use it in GitHub Desktop.
Showing off how to use applyAsync to display a spinner while a long query is running in Aras Innovator.
var applyWithSpinner = async function(itm) {
aras.browserHelper.toggleSpinner(document, true);
var res = await itm.applyAsync();
aras.browserHelper.toggleSpinner(document, false);
return res;
}
// Create a query we know will take a while like querying for all Methods in the system
var longQueryItem = aras.IomInnovator.newItem("Method", "get");
var res = await applyWithSpinner(longQueryItem);
alert("Performed query and found " + res.getItemCount() + " Methods");
@MAkallal
Copy link

Interesting, however, how this code can be used with applyMethod() to call as server side method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment