Hello, I’ve got this components:
// views/home.ts
import { JetView } from "webix-jet";
import Header from "./layout/header";
import Sidebar from "./layout/sidebar";
export default class HomeView extends JetView {
config() {
return {
css: "app",
rows: [
Header,
{
cols: [Sidebar, { $subview: true }],
},
],
};
}
}
// views/layout/sidebar.ts
import { sidebarConfig } from "models/sidebarConfig";
import { JetView, plugins } from "webix-jet";
export default class SidebarView extends JetView {
config() {
return {
id: "app:sidebar",
css: "app__sidebar",
view: "sidebar",
};
}
toggleSidebar() {
(this.getRoot() as webix.ui.sidebar).toggle();
}
init(view): void {
view.parse(sidebarConfig);
this.use(plugins.Menu, { id: view });
this.on(this.app, "sidebar:toggle", () => {
this.toggleSidebar();
});
}
}
As you can see I am including the sidebar component in every first-level view (e.g. views/home.ts). My problem is that when I’m navigating to other pages the function “Menu(app, view, config)” of the menu Plugin throws an error:
Cannot read property ‘parent’ of null
That’s (of course) because “view.getSubViewInfo()” evaluates to null…
How can I fix this issue?
Thanks
L.