Forum Discussion

detroit's avatar
detroit
Creator I
8 years ago

javascript innovator.applyMethod async

Hello is there an applyMethod method that returns promise? How do you apply spinners in these cases? I show spinner and start applyMethod but it always shows only after its too late...after the applyMethod is done executing/request returns result. Seems like who gui "thread" is blocked meantime   best regards

3 Replies

  • Hi Detroit,

    Did you solve this? I am also facing the same issue. Not able to show progress loader when using iomItem.apply().

    Please let me know if you any solution around this.

    Thanks

    Vinay

  • Hello,

    I'd recommend checking out the answers to two different forum posts. The answers here cover how to toggle the spinner when you have code you know will take some time to execute. Secondly, the answer here walks through how to use the applyAsync method on the Item object. 

    Basically, you could write a function like the one in the Gist below to start a spinner, perform a long query with applyAsync, and then stop the spinner. If you're not familiar with the apply/async keywords in JavaScript, I'd also recommend checking out this handy article.

    https://gist.github.com/cgillis-aras/ea18abe9c0e94c6e858c544f5d9c077e

    Chris

    Christopher Gillis

    Aras Labs Software Engineer