I have the following code that worked in webix 5 (webixjet):
import View1 from "views/view1";
import View2 from "views/view2";
import View3 from "views/view3";
export default class StartView extends JetView {
config() {
var uiFrame = {view: "form", id:"myviews", borderless:true, padding:0,
elements: [ {view:"multiview", id:"mymultiview", cells:[
{$subview:View1},
{$subview:View2},
{$subview:View3},
],
}
]
}
// Return UI
return uiFrame;
}
init() {
this.view1 = this.ui(View1);
$$("view1_form").hide();
this.view2 = this.ui(View2);
$$("view2_form").hide();
this.view3 = this.ui(View3);
$$("view3_form").hide();
// initialize first view
this.view1.initView('');
}
changeView(viewID,data) {
if (viewID == 'view1') {this.view1.initView(data); $$("view1_form").show(); }
if (viewID == 'view2') {this.view2.initView(data) }
if (viewID == 'view3') {this.view3.initView(data) }
}
};
I call the changeView function from within views 1,2,3 to switch to a different view.
The code is actually a shortened version because there are about 7 more views in the actual code that I change between.
After upgrading to webix 7 (webixjet) I get a lot of duplicate id error messages when I start this view from a menu. I can see why since i’m loading the views a second time so I have access to the initView functions in the views. How can I do this differently?
Thank you,
Pieter