PDA

View Full Version : 5 seconds after the label.hide()



muceli
30 Jan 2013, 7:04 AM
Hello,
There is a label. This label is hidden. I'm with the show function. 5 seconds after getting back to the show, I have to hide the label, but how?

friend
30 Jan 2013, 10:51 AM
This example uses a button, but you can adapt it to your needs.



Ext.create('Ext.window.Window', {
bodyPadding: 5,
height: 200,
title: 'Button show/hide test',
width: 300,
items: [{
xtype: 'button',
hidden: true,
text: 'A Button'
}],
buttons: [{
text: 'Show button',
handler: function() {
var targetButton = this.up('window').down('button');
targetButton.show();

Ext.defer(function() { targetButton.hide();}, 5000);

}
}]
}).show();Ext.create('Ext.window.Window', {
bodyPadding: 5,
height: 200,
title: 'Button show/hide test',
width: 300,
items: [{
xtype: 'button',
hidden: true,
text: 'A Button'
}],
buttons: [{
text: 'Show button',
handler: function() {
var targetButton = this.up('window').down('button');
targetButton.show();
Ext.defer(function() { targetButton.hide();}, 5000);
}
}]
}).show();

muceli
30 Jan 2013, 11:46 PM
Thank you for your answer. So, show () again within 5 seconds after the button is pressed (the arrangement) How can we increase 5 seconds. So if it is will increase again within 5 seconds press the 1 second after that time do not press the hide () will be.