How to display a progress spinner in a JavaScript app for a geoprocessing service?

2600
2
04-07-2016 12:51 PM
JimBob3
New Contributor


I have a JavaScript application I am creating that has a possibly long running geoprocessing service, depending on the inputs that they select.  I want to display a spinning progress wheel so users know the service is still running. Any suggestions on the best way to go about this? There is no event for when a geoprocessing service is started, just job-complete, job-cancel, and status-update.

Jim Bob

0 Kudos
2 Replies
thejuskambi
Occasional Contributor III

You can start the the load indicator, after calling task execute method. Since it is deferred, your indicator will start first before any of the events are called.

ArjunDongre
Occasional Contributor

I use the dojox standby widget. Just set it to "show" just before I execute my geoprocessing task. Then set it to hide within the success callback (or error callback).

Set the "target" parameter to the dom node that you are interested in displaying the standby spinner over, but then you also have to append the standby widget to the document body node as well:

var standby = new Standby({target: "info"});

document.body.appendChild(standby.domNode);

0 Kudos