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'
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(); } }