Serialize not work if the data are loaded from file

Hi, see this example.

https://snippet.dhtmlx.com/d2esrk9j

is a bug?

tks in advance

Emilio

Please note in case of load() method

data loading is asynchronous, so you need to wrap any after-loading code into a promise:

component.data.load(url).then(function(){
    //do something after load;
});

or

component.data.load(url);
component.data.loadData.then(function(){
    //do something after load;
});// loadData executes a callback function after an asynchronous// data loading has completed

so talking about the serialize() calling from the console.log in your snippet you should do:

datacollection.load("https://snippet.dhtmlx.com/codebase/data/datacollection/01/dataset.json").then(function () {
    console.log(JSON.stringify(datacollection.serialize(), null, 4)); //call the needed code from the callback function
    printData(datacollection, "data");
});

Here is the updated snippet:
https://snippet.dhtmlx.com/0iin4j06

Good and tks :wink:

Emiliio