I have a border Layout with let's say two regions; center and west. The westregion is added with the splitter param and is collapsible. Now I have a toolbar from which I want to hide/show the west region. I've solved this by calling the toggleTargetCmp()
method of the splitter. Well I know, this is a private method and should not be used, but I found no other way to archive this. So far so good. All this works.
But now I want to hide the splitter & placeholder (I fetch the placeholder ownet by using the getCollapseTarget()
method of the splitter) if the button in the toolbar gets clicked. I tried it with setVisible(false)
which works for the splitter but it didn't work well for the placeholder... after a deeper look onto the placeholder instance I can tell that it is set to hidden: true
but it uses the hideMode: 'offsets'
by default plus hiddenAnchestor: false
which is not documented in the API.
Based on the API docu for hideMode I tried to set it to 'display'
before calling setVisible(false)
without any luck, the placeholder still stays visible.
So how can I hide the placholder, too. Or is there even a better way to archive this?
Have you tried hide method? It works exactly as you describe - hides region and splitter. In my project I do it like this:
panel.hide();
where panel is one of borderPanel items.
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