javascript - Ext JS Border layout: how to collapse a region programmatically? -
i have panel "border" layout, having "center" , "north" region. want programmatically collapse north region, , according forum way is:
container.layout.north.collapse();
however, container.layout string object container.layout.north giving me null object.
does have 2 seconds pointer on how handle correct layout object call collapse() upon?
the cheapest way hold of panel need calling ext.getcmp()
. container.layout
undefined because not object of ext.component. set id border panel or panel need access to.
var panel = ext.getcmp('borderpanelid'); panel.layout.north.collapse();
another way use north panel's id. in case will:
var panel = ext.getcmp('northpanelid'); panel.collapse();
another way make user of ref
system. set ref property panels. , if have access component's owner.. can simple use ref reference panel or other components.
Comments
Post a Comment