Skip to content

Instantly share code, notes, and snippets.

@zubairov
Created March 15, 2011 10:10
Show Gist options
  • Save zubairov/870542 to your computer and use it in GitHub Desktop.
Save zubairov/870542 to your computer and use it in GitHub Desktop.
Sample on how to implement loading indicator in Sproutcore application
SC.Request.manager.inflight.addObserver('[]', function(array) {
var length=array.get('length');
SC.debug('Number of inflight requets are %@', length);
// Need to run with the SC Event Loop to update the visuals
SC.run(new function() {
App.mainPage.getPath('mainPane.loading').set('isVisible', length > 0);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment