Working example of this Webix Jet recipe

Hello,

I'm trying to create base classes of views using this example (https://webix.gitbook.io/webix-jet/part-ii-webix-jet-in-details/views-and-subviews). I'm using the example:

// views/basedatatable.js
import {JetView} from "webix-jet";
export default class BaseDatatable extends JetView {
    constructor(app, name, config){
        super(app, name);
        this.config = config;
    }
    config(){
        return { view:"datatable", columns: this.config.columns };
    }
}

// views/products.js
import {BaseDatatable} from "webix-jet";
import products from "models/products"; //data collection
export default class ProductsView extends BaseDatatable {
    constructor(app, name){
        super(app, name, {
            columns:[
                {id:"id",header:""},
                {id:"product",header:"Product"},
                {id:"stock",header:"In stock"}
            ]
        });
    }
    init(view){
        view.parse(products);
    }
}

But am getting the error: "Super expression must be null or function, not undefined". Can anyone provide a working example of this?

Thanks

Tagged:

Comments

  • I figured this out. Not sure why, but:

    import {BaseDataQueryView} from "webix-jet";
    

    couldn't resolve. I had to use:

    import BaseDataQueryView from "./BaseDataQueryView";
    
  • Hello,

    Yes, you are right. We will correct it in the documentation.
    Sorry for the inconvenience.

  • No problem!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!