ES6 module support?

edited March 20 in Technical questions

We have just started using WebixPro v.7.2.2 and I am still learning how to use it and currently have the following setup:

1 - The index.html file uses the following script tags to access webix.js:

<script src="path/to/webix/codebase/webix.js" type="text/javascript" charset="utf-8"></script>

2 - And my local javascript code as:

<script src="path/to/local.js" type="module" charset="utf-8"></script>

3 - In my local module I do something similar to:

import { data } from './data.js';

webix.ready(function () {
webix.ui({
view:"datatable",
columns:[
data
],
datatype:"xml"
url:"data/data.xml"
});
});

4 - When I l load the page I get the following error in the console:

Not existing parent:undefined webix.js:362

I am not even sure if Webix supports this type of setup, I sure hope it does. Any help figuring this out, pointers to documentation, etc. are very much appreciated. If I can provide more information please let me know.

Thanks,

Daryl Williams

Comments

  • Hello @Daryl,

    I am not even sure if Webix supports this type of setup, I sure hope it does. Any help figuring this out, pointers to documentation, etc. are very much appreciated. If I can provide more information please let me know.

    According to our tests the following structure should indeed work absolutely fine.

    When I l load the page I get the following error in the console: Not existing parent:undefined webix.js:362

    I am actually not quite sure as to why you are getting this error, seeing how the code worked without any issues following your structure. I did notice a few issues in your syntax, however, that doesn't seem to be the cause of the error. Either way, the syntax should look like this:

    //module
    
    import { data } from './data.js';
    
    webix.ready(function () {
      webix.ui({
        view:"datatable",
        columns:data,
        datatype:"xml",
        url:"data/data.xml"
      });
    });
    

    As for the error itself, it is most likely caused by the incorrect initialization of the ui. Does the provided code match the code you are using in your project? Could you also please provide the full error stack from the console?

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!

In this Discussion