Preserve Instance of Views in the Desktop widget


I have a Jetapp, and in this Jetapp I am experimenting with adding a Desktop. What I am trying to accomplish is having a desktop view with several apps that represent specific functionality available for different users. I would like for the desktop view once created to persist with open windows and their current state if the user navigates to a different part of the app, and when they navigate back to the Desktop view via the menu they should expect to see everything as it was before they navigated to another part of the app.

Right now it seems that every view is destroyed and recreated. I guess what I am looking for is a way to have a singleton view that will simply be hidden or shown during navigation. Any assistance would be greatly appreciated.

Good day,

We have already answered this question by email but I will duplicate the answer from my collegue here as well:

When the common Jet navigation is used, the framework always destroys the previously opened JetView.

This is one of core features we chose for an SPA with no unexpected background processes.

However, it is possible to combine this way of navigation with a Multiview that manages only the visibility of its content.

In this case, one of the cells will contain a dynamic subview (where JetViews will be loaded and destroyed, as usual), while other will be hidden and can contain plain Webix UI as well as static subviews.

As for the possible flaws,

  • URL of the app depends on the current structure of dynamic subviews, so Multiview will not change the URL segments. Depending on the use-case, you may need to use an EmptyRouter, add more specific URL parameters, or a placeholder (an empty view) in dynamic subviews while another Multiview cell is active.

  • Currently, the inner windows of the Desktop will remain on top of other views even if Desktop itself is hidden. I confirm a bug here, but for now, these windows needs to be hidden by hand with the Desktop and then restored (the related lines are 149-150, 44-45, 47-69 in the below example).

Here’s a snippet of the suggested solution: Code Snippet .