Kenny Meyer
Kenny Meyer

Reputation: 8027

How to show Loading Screen in Browser with Sencha Touch 2

Disclaimer: I know how to create a startup screen on mobile devices.

Is it possible to show a loading screen for a Sencha Touch 2 application if accessed via the browser?

If yes, please give a concise, working example. Proof-of-concept app, Gist, source, you know.

I am talking about something like the Sencha Docs loading screen:

Sencha Docs loading screen

Upvotes: 0

Views: 4274

Answers (2)

M165437
M165437

Reputation: 967

You can add a loading indicator to your index.html. Just make sure it loads fast so the user gets an instant feedback that something is going on.

<div id="appLoadingIndicator"></div>

Once the app launches call

// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();

This is done for you in case you use Sencha Cmd to generate new applications.

Also have a look at these smooth CSS3 indicators for inspiration.

Upvotes: 1

john
john

Reputation: 1282

yourContainer.setMasked({
    xtype: 'loadmask',
    message: 'Loading...'
});

then add a timer

setTimeout(function() {
    // code to be executed when loading
    // Unmask the container
    form.setMasked(false);
}, 5000);

Upvotes: 0

Related Questions