Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试执行以下操作:当用户单击按钮时,子面板将显示/隐藏
但是当我按下按钮时,我收到此错误消息:
未捕获的类型错误:对象 [对象对象] 没有方法“子”
从外观上看,您需要通过它的“id”来引用您的子面板,我猜它是上面代码中的“p”。
所以你想要这样的东西:
function: onbtnClick(show) { var childPanel = Ext.getCmp('p'); if(show) { childPanel.show(); } else { childPanel.hide(); } }