Get All Views

I’m building an SPA that also incorporates webix views for complex HTML nodes. Unlike a typical website, I must find and destroy all existing webix views as part of the page tear down. Does webix have a destroyAll, getAll, or global view ID index? I would like to avoid creating another state object to manage each of the webix views I have created if at all possible.

Hello,

The whole collection of currently created views is stored in webix.ui.views.

Or, you can apply the queryView method to the top Webix view.

Please, check: https://snippet.webix.com/pp5r4pl6

Thanks.

For anyone else looking, destroying all views can be done like so:

for (let key of Object.keys(webix.ui.views)) {
if (webix.ui.views[key] && webix.ui.views[key].destructor) {
webix.ui.views[key].destructor();
}
}