Vidar Vestnes
Vidar Vestnes

Reputation: 42984

How to change loadingText on a Panel with Sencha Touch?

I'm using setLoading(true) on a Panel, but cant find a way to change the "Loading..." text below the spinner.

I need at least to translate it to Norwegian.

app.views.ForfallDetaljerView = Ext.extend(Ext.Panel,{
    id: 'forfalldetaljer',
    scroll: 'vertical',
    dockedItems: [ new app.views.BackToolbar({
        title: 'Detaljer',
        buttonHandler: function(){
            Ext.dispatch({
                controller: app.controllers.forfallDetaljer,
                action: 'back',
            });
            // Clear view
            app.views.forfallDetaljer.update('');
        }
    })],
});

app.myview = new ForfallDetaljerView();
app.myview.setLoading(true);

Anyone got any idea?

Upvotes: 2

Views: 7048

Answers (2)

mistagrooves
mistagrooves

Reputation: 2337

app.myview = new ForfallDetaljerView();
var mask = new Ext.LoadMask(app.myview.el, {msg: "<text here>"});
mask.show();

You can then do a mask.hide() when you want to remove it.

You could also do something like:

var l = app.myview.setLoading(true);
l.el.down('div.x-loading-msg').setHTML("<text here>");

So hopefully these two options point you in the right direction.

Upvotes: 2

ballmw
ballmw

Reputation: 955

There's another way to show the loading message:

var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});
myMask.show();

Both Panel.setLoading(true) and Ext.LoadMask(...) return a LoadMask object. So it should work similarly.

http://dev.sencha.com/deploy/touch/docs/?class=Ext.LoadMask

Upvotes: 0

Related Questions