# system.nav.swapTo not closing the previous docked window

**URL:** <https://forum.inductiveautomation.com/t/system-nav-swapto-not-closing-the-previous-docked-window/35768>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [June 17, 2020, 6:10pm UTC](https://forum.inductiveautomation.com/t/system-nav-swapto-not-closing-the-previous-docked-window/35768 "2020-06-17T18:10:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 17, 2020, 6:10pm UTC](https://forum.inductiveautomation.com/t/system-nav-swapto-not-closing-the-previous-docked-window/35768/1 "2020-06-17T18:10:16Z")

</div>

I’m creating an application on an old 7.8 server. (I know … but it’s not mine.)

- All the windows are docked.
- The menubar is set to _West_.
- All the other windows are set to “East”.
- When start the application only the menubar appears on the left.
- When I click the button for the first window it pops up on the east as expected but with a large gap between it and the menubar.
- Selecting additional menu buttons opens up the additional windows but they all get attached on the east nudging the previous windows further and further off the screen. I can close them all with the Ignition Window menu.
- The _Event Handlers - action - actionPerformed_ is generated by the _Navigation_ option and the resultant code for each button looks like this:

```auto
# This script was generated automatically by the navigation
# script builder. You may modify this script, but if you do,
# you will not be able to use the navigation builder to update
# this script without overwriting your changes.

system.nav.swapTo('Docked windows/EC Temperatures')

```

Can anyone remember back to 7.8.2 to advise me what the problem might be?

Many thanks.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 17, 2020, 6:23pm UTC](https://forum.inductiveautomation.com/t/system-nav-swapto-not-closing-the-previous-docked-window/35768/2 "2020-06-17T18:23:32Z")

</div>

`swapTo` has not ever been intended for use with docked windows; it’s designed to close a detected “Main” window and replace it with a new one. I’m struggling to find the use case for _all_ windows being docked, but, I suspect you’ll have to write your own swap function that closes anything besides your docked menubar, then opens the passed in window.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 17, 2020, 10:18pm UTC](https://forum.inductiveautomation.com/t/system-nav-swapto-not-closing-the-previous-docked-window/35768/3 "2020-06-17T22:18:56Z")

</div>

Thanks for that, Paul.

What’s the right way then? Should I convert the menu window into a template and add that to each page, treating each as a main window?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 17, 2020, 10:22pm UTC](https://forum.inductiveautomation.com/t/system-nav-swapto-not-closing-the-previous-docked-window/35768/4 "2020-06-17T22:22:11Z")

</div>

If you’ve already got your windows laid out they way they should be, you shouldn’t need a great deal of effort. Just change the window properties such that your current east-docked windows match the ‘expected’ settings for main windows: [https://docs.inductiveautomation.com/display/DOC80/Window+Types](https://docs.inductiveautomation.com/display/DOC80/Window+Types), and `swapTo` should start working.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 17, 2020, 11:15pm UTC](https://forum.inductiveautomation.com/t/system-nav-swapto-not-closing-the-previous-docked-window/35768/5 "2020-06-17T23:15:53Z")

</div>

That was it, thanks, Paul.  
Thank you for your time.
