Shadin
Shadin

Reputation: 1967

Extjs 4 Uncaught TypeError

I am trying to do something like: when user click on the button, the child panel will show/hide

but when i press on the button i get this error message :

Uncaught TypeError: Object [object Object] has no method 'child'

Upvotes: 0

Views: 859

Answers (1)

dougajmcdonald
dougajmcdonald

Reputation: 20067

By the looks of things you need to refer to your child panel by it's 'id' which I guess is 'p' from your code above.

So you'd want something like this:

function: onbtnClick(show) {

    var childPanel = Ext.getCmp('p');
    if(show) {
        childPanel.show();
    } else {
        childPanel.hide();
    }
}

Upvotes: 1

Related Questions