Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add content to blank main window? #216

Open
adityatoshniwal opened this issue Aug 1, 2023 · 4 comments
Open

How to add content to blank main window? #216

adityatoshniwal opened this issue Aug 1, 2023 · 4 comments

Comments

@adityatoshniwal
Copy link

Hi,

I have created a main panel(locked) with all tabs closable. I want to show something on the blank main panel when all the panels are closed.
How can I do that?

Thanks.

@rayman-de
Copy link

Give your main panel an id (e.g. "main") and then use dockMove(newTabData, "main", "middle") to add a tab to your main panel. (newTabData should hold the TabData of the content that you want to show., e.g. let newTabData = {content: <div>This is a new tab</div>, title: "New Tab", closable: true})

@adityatoshniwal
Copy link
Author

@rayman-de That's the tab content. I am talking about the panel content when all the tabs are closed.

@rayman-de
Copy link

A panel is a container for tabs, it is not meant to hold content by itself. As a workaround, you could pass a handler to the DockLayout's onLayoutChange prop that switches the layout with a placeholder once the panel has no tabs.

@adityatoshniwal
Copy link
Author

@rayman-de I understand. But a panel can be blank - if it can be blank then it should allow some content. Taking an example of VS-Code which shows some content when no tabs are open.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants