Changing the docked window?

I have two different windows I want to use as North docked windows at different points. One is thin with just the company logo, and lets the Main Window take up all the screen real estate. The second one has components of its own that are general use filtering that can be used by different tables, where it would take up about half the screen and the main window would just be a table on the bottom half of the screen.

I read here on the forum elsewhere that @PGriffith said that swapWindow was never intended for docked windows. Is there a “right” way to swap docked windows or is that not supported at all?

And even if there is no system.nav.properWaytoSwapDockWindows type function, is there a work around to get this done, swapping docked windows?

I tried using the system.nav.swapWindow, and when I go from a window that has the big header to a window with the small header, the small header gets stretched out to the size of the big header like this

So I don’t know if this is a viable way to do it or if I am missing something basic.

Can’t you just closeWindow and openWindow in a script? You could maybe do it “smartly” during activation of the window(s) that have the table in question?

I do wonder if a docked window is even necessary here - why not just put your table config in a template instance above the table in question? If you want to persist data across navigation, store in client tags?

1 Like

Ok I can try it like that, does opening a window that I want to be north docked require any additional arguments to make it so?

So you see in my screen shot I have a tab that has 7 tabs - Under each tab is a table with thousands of rows, with plans for at least 3 more additional tabs. This window is very slow, and during a trouble shooting session with Ignition the only way to make it reasonably faster is to put each table on its own window. However, I don’t want to reload the tree every time this happens, even inside a template, due to it having over 15,000 items and itself being a resource hog. I also have a few other windows where I’d like the tree and filters to be, and to avoid having to reload them when possible, which is why I am opting to have a thick docked header that doesn’t change out if it doesn’t have to.

Unless I am misunderstanding your idea for a different implementation. I will end up storing the filter values in client tags that are grabbed from the db and updated when the user updates them.

I believe you are looking for system.nav.swapWindow
from documentation.

Performs a window swap. This means that one window is closed, and another is opened and takes its place - assuming its size, floating state, and maximization state. This gives a seamless transition - one window seems to simply turn into another.

The docking, position and what not should be stored in the Window and not require anything extra.

I have a project where I use docked windows as a menu tree. all I had to do was make sure the dock and index were set in the window.

The when swapping around all I do is open that window and close everything else minus current and home window via a script.

Gotcha - no, you’re probably right that this is a better approach for your needs here.
You should just be able to closeWindow() and openWindow(), yeah. The window ‘knows’ it’s supposed to be docked.

1 Like