Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtJS Button text change

Tags:

extjs

I am designing a button in ExtJS with text Show, when I click on button, I want to change text as Hide

How can I handle this.

Plz Help me.

Thanks in advance

like image 583
MNR Avatar asked Apr 21 '11 05:04

MNR


2 Answers

Use the click event of the button and change the text to "Hide".

listeners : {
    click: function(button,event) {
        button.setText('Hide');
    }
}
like image 52
Abdel Raoof Olakara Avatar answered Sep 19 '22 09:09

Abdel Raoof Olakara


If you work with mvc then you will use this code

'widgetName button[text=Show]': {
    click: function(button, el) {
        button.setText('Hide');
    }
}
like image 25
Omar Faruq Avatar answered Sep 23 '22 09:09

Omar Faruq