MNR
MNR

Reputation: 275

ExtJS Button text change

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

Upvotes: 9

Views: 19036

Answers (2)

Omar Faruq
Omar Faruq

Reputation: 1220

If you work with mvc then you will use this code

'widgetName button[text=Show]': {
    click: function(button, el) {
        button.setText('Hide');
    }
}

Upvotes: 6

Abdel Raoof Olakara
Abdel Raoof Olakara

Reputation: 19353

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

listeners : {
    click: function(button,event) {
        button.setText('Hide');
    }
}

Upvotes: 22

Related Questions