In EXT.Panel, there are two methods for collapsing/expanding a Panel.
collapse(Boolean animate)
and expand (Boolean animate)
calling collapse(true) and expand(true) gives me desired results. But I was hoping to achieve the result of expand(true) by calling collapse(false). But collapse(false) does nothing. Why is this?
because
collapse()andexpand()functions don’t check if panel is currently in expanded or collapsed mode,so if you call
expand()on already expanded panel it will silently ignore the function call, you can usetoggleCollapse()to collapse/expand based on current state of the panelExtra:
the parameter used in collapse/expand functions is
animatewhich just specifies the transition will be animated or not, it doesn’t specify the state of the panel socollpase(false)just means the panel will be collapsed without any animation, but it if panel is already collapsed then function will just silently return without any processing, so in shortcollapse(false)is not equal toexpand(true)