Select to view content in your preferred language

Javascript Spinner with ArcGIS Javascript API

5018
2
Jump to solution
01-15-2015 07:26 AM
DamienRobinson
Deactivated User

Hi,

I'm working on a custom javascript based viewer. This viewer will allow a user to perform a query, then it zooms to the relevant extent. This aspect is working great. However i'd like to add a jquery spinner when the query is performed and stop it once the extent has been zoomed to.

For whatever reason, I can't get this spinner to work within the script tags of the arcgis javascript viewer.

I have tried various methods using javascript and other libraries. The basic methodology i'm pursuing is to create two functions, one to stop the spinner, the other to hide the spinner. I downloaded the javascript and css files from the following github: jQuery Spin‌ . I have referenced these in the head of the html page. I have placed the following functions in the map viewer script tags.

function stopSpinner(){

$('.spin').spin('hide');

};
function startSpinner(){

$('.spin').spin('show');

};

The startSpinner() function will be called on the same button click as the query operation, the stopSpinner() would be called immediately after a getExtent call.

Are there any issues with using jquery and the arcgis javascript api ?

Any advice would be greatly appreciated.

Thanks,

Damien

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JoshHevenor
Frequent Contributor

Since you're using the esri API I'll point you towards the quick and easy dojo solution: dojox.widget.Standby — The Dojo Toolkit - Reference Guide 

View solution in original post

2 Replies
JoshHevenor
Frequent Contributor

Since you're using the esri API I'll point you towards the quick and easy dojo solution: dojox.widget.Standby — The Dojo Toolkit - Reference Guide 

DamienRobinson
Deactivated User

Thanks Josh! This is great!

0 Kudos