Jet 1.0 Insert a JetView into another Jet View in a window

Hello,

I am stucked with the following:
I have two Jet views (in 2 js-files) and I want to show the second Jet View in the first in a window.
I always get the error:
Cannot call a class as a function

How to do that? It was quite simple in former Webix Jet Versions…

Thanks,
Martin

Update to jet 1.0.6 and you will be able to use

init(){
    this.win1 = this.ui(WindowView)
    //this.win1.show();
}

where WindowView is like next

class WindowView extends JetView{
  config(){
           return { view:"window", body:{} };
  }
  show(target){
       this.getRoot().show(target);
  }
}

Hello, I’ve upgraded to 1.0.6 but I’m not sure how to reproduce your code. I’ve tried different things without success.

// The Jetview to embed in a window
import { JetView } from "webix-jet";

export default class MyEmbeddedJetview  extends JetView {
    config() {
        return {
            template: "This should be embedded in a window"
        };
    }

    show(target) {
        this.getRoot().show(target);
    }
}

Then I define the container Jetview:

// The Jetview that should embed the first one
import { JetView } from "webix-jet";
import MyEmbeddedJetview  from "./myJetview";

export default class MyContainerJetview extends JetView {
    config() {
        return {
            // ...
        }
    }

    init() {
        const winTest = {
            view: "window",
            position: "center",
            width: 300,
            height: 200,
            body: {
                rows: [
                    { template: "hello" },
                    { template: "world" } // TEST 1:  works fine
                ]
            }
        };

        this.winTest= this.ui(winTest);
    }
}

TEST 2: same window with a Jetview embedded => this does not work:

        const winTest = {
            view: "window",
            position: "center",
            width: 300,
            height: 200,
            body: {
                rows: [
                    { template: "hello" },
                    MyEmbeddedJetview // TEST 2 : the window is blank
                ]
            }
        };

Fixed in Webix Jet 1.2

I can’t believe how reactive you are. You are amazing guys!