// views/common/windows.js
import {JetView} from "webix-jet";
export class CommonWindow extends JetView {
config() {
return {
id: "window-common-id",
view: "window",
modal: true,
position: "center",
head: {
view: "toolbar",
css: "highlighted_header header6",
cols: [
{
view: "label",
id: "window-common-header-id",
label: "Serial Number",
css: {"color": "black !important"}
},
{view: "button", label: "X", width: 35, type: "danger", click: () => this.popup.hide()}
]
},
body: {
view: "form",
elements:[
{
id: "list-common-id",
view: "list",
scroll: true,
template: "#name#",
data: []
}
]
}
};
}
init(view, url) {
this.popup = this.$$("window-common-id");
this.popup_list = this.$$("list-common-id");
}
ready(view, url) {
}
initWindow(params) {
this.popup_list.clearAll();
this.popup_list.load("api/test?" + jQuery.param(params, true));
this.popup.show();
}
}
// views/first_menu.js
import {JetView} from "webix-jet";
import CommonWindow from "jet-views/views/common/windows";
export class FirstMenu extends JetView {
config(){
return {
view: "button",
type: "iconButton",
icon: "plus",
width: 120,
label: "FirstMenu",
click: ()=>{
this.common_popup.initWindow({id: 1});
}
}
}
init(view, url){
this.common_popup = this.ui(CommonWindow);
}
}
// views/second_menu.js
import {JetView} from "webix-jet";
import CommonWindow from "jet-views/views/common/windows";
export class SecondMenu extends JetView {
config(){
return {
view: "button",
type: "iconButton",
icon: "plus",
width: 120,
label: "SecondMenu",
click: ()=>{
this.common_popup.initWindow({id: 2});
}
}
}
init(view, url){
this.common_popup = this.ui(CommonWindow);
}
}
first time i’m click button on FirstMenu for call CommonWindow is working but when I go to SecondMenu and click button for call CommonWindow is not working seem like window is not refresh.
for example
- text on header window is missing.
- when I import subview into body of window seem like is not refresh.
Please let me know to use this.ui() with window
old version use $windows: [CommonWindow] is working