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()
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With