Sencha Sencha - Pause before disclosure

I want to delay the display of the sencha touch button element for a few seconds. How should I do it?

I have the following [item]

                        xtype: 'button',
                        align: 'right',
                        hidden: false,
                        html: 'Go!'

How can I delay an impression, for example, 10 seconds?

thank

+5
source share
2 answers

I think it’s better to use Ext.util.DelayedTask

http://docs.sencha.com/touch/2-0/#!/api/Ext.util.DelayedTask

+2
source

You can use the following code snippet:

setTimeout(function(){
    Ext.ComponentManager.get('MyPanel').add({
        xtype:'button',
        align:'right,
        html('Go!')
    });        
}, 10000);

It is assumed that you have a panel or container with the id configuration set to MyPanel as the parent of the button you want to add. You can do this in one of your controllers, for example.

, , :

{
     xtype: 'button',
     align: 'right',
     hidden: false,
     html: 'Go!',
     id:'MyButton'
}

'hidden' setTimeout:

setTimeout(function(){
    Ext.ComponentManager.get('MyButton').setHidden(false);
}, 10000);

, , .

+1

All Articles