EXTjs Panels collapse and expand methods
extjs3
Solution
because `collapse()` and `expand()` 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 use `toggleCollapse()` to collapse/expand based on current state of the panel
panel.toggleCollapse(true);
Extra:
the parameter used in collapse/expand functions is `animate` which just specifies the transition will be animated or not, it doesn't specify the state of the panel so `collpase(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 short `collapse(false)` is not equal to `expand(true)`
Problem
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?