FlexLayout icon indicating copy to clipboard operation
FlexLayout copied to clipboard

how can i show/hide tab

Open yuanchangjian opened this issue 3 years ago • 7 comments

How do I do this when I switch different tabs in tabset, the tab inside the border can be hidden or displayed?

yuanchangjian avatar Oct 08 '21 02:10 yuanchangjian

you can use the action Actions.selectTab(tabId) to select a tab in its tabset

nealus avatar Oct 08 '21 07:10 nealus

you can use the action Actions.selectTab(tabId) to select a tab in its tabset I want to hide the tab inside the border, but I don't want to call addNode and deleteTab

yuanchangjian avatar Oct 08 '21 08:10 yuanchangjian

Whether you can provide a visible property to control this behavior?

yuanchangjian avatar Oct 08 '21 08:10 yuanchangjian

No, sorry, add/remove is the only way to do this

nealus avatar Oct 08 '21 09:10 nealus

This property should be added as an improvement request,similar to the show field in the border

yuanchangjian avatar Oct 08 '21 11:10 yuanchangjian

The ability to programmatically control border tab visibility would be SO helpful. Until I found this issue, I thought for sure the below code would work and was surprised when it didn't:

model.doAction(FlexLayout.Actions.updateNodeAttributes(border.getId(), { show: true }));

I guess I confused "show" for what something like an "expanded" attribute would do though.

ericsvendsen avatar Dec 30 '21 01:12 ericsvendsen

Hmm, ok nevermind. Calling selectTab will indeed cause the border tabset to expand. Sorry, I think I misunderstood the original intent of this issue.

ericsvendsen avatar Dec 30 '21 15:12 ericsvendsen