ES6 module support?

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:

2 - And my local javascript code as:

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

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?

Hi @Dzmitry, thank you for your reply. I Just wanted to let you know that using ES6 modules appears to work just fine. In my test code I am using ES6 modules to structure my app and import my webix widget definitions and so far everything works as expected. As to that specific error I believe you’re right, it was due to some misconfiguration on my part and it as resurfaced since restructuring the app.

Thanks again,

Daryl