-
Notifications
You must be signed in to change notification settings - Fork 82
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
virtually rendered panels #841
Comments
Dockview does has an https://dockview.dev/docs/core/panels/rendering When the panel is rendered as As a quick example here, As you mentioned this is exactly the approach you would need to take for something like iframes where re-positioning the element within the DOM causes the iframe to reload; using Within the demo if you enable the debug-like mode you are able to switch between the renderers on the fly and see in realtime how this works by inspecting the DOM too. Hopefully this answers your questions, but let me know otherwise and I can explain in more depth. |
Thanks. I wondered if might be the case, but I didn't find a clear answer. This page implies the behavior. Perhaps after "they are never removed from the DOM" you could add "or moved within the DOM". You might also mention either here and/or here that if So a common use-case for "virtual rendering" is handled. What about the more general case, such as the example I mention following "A more complicated use-case"? This shouldn't be difficult to implement. Perhaps add a |
Is there a recommended and documented way to render a Panel using an element outside the dockview element hierarchy? Specifically using elements that do not get re-parented when components are moved, perhaps using an element (the "content element") that is a direct child of the
<body>
element. When a component is moved, dockview would call an application-provided callback "hook" or event handler which would update the position, size, and visibility of the content element.This ability would fix the problem of iframes being reloaded, though it may be overkill for that problem.
Part of this can be done using a
ResizeObserver
but I think it would be better to have a documented API or at least an example.I do suggest that if a Panel has
renderer
set toalways
then perhaps it should be default be virtual and its parent element be one that never moves. Perhaps a sibling or an immediate child of the dockview element.A more complicated use-case is when you use an embedded browser (like Electron, Qt WebEngine, or Tauri). In that case if can be useful to embed a toolkit widget or a separate WebView (like an iframe - but top-level) as a panel. Using "virtual" panels and callback functions these nested widgets can be coordinated.
Context: I have been using GoldenLayout for DomTerm, and I contributed the
dev
branch to GoldenLayout. Currently, nobody (including me) has time to work on GoldenLayout. An actively maintained alternative would be welcome - assuming it has the needed functionality. GoldenLayout has long supported "virtual" layouts.(I have not tried to use dockview, except for the demo, and it will be a while before I have the time. However, before I dig deeper, I thought I'd ask for clarification on this use-case.)
The text was updated successfully, but these errors were encountered: