Batch addition on DataStore

I’m trying to do a batch data import from a defined array (not a view item).

I have not found any function to add multiple element at once (just to clear them).
I’ve tryied with the Array.prototype.forEach but, unless you provide an scope for it, it rises an “Script error”:
http://webix.com/snippet/bc3e8259

Is there an efficient way to add multiple values at once?

Thank you.

You can use

$$("myList").parse(data);

http://webix.com/snippet/750eaba1

Cool, thanks.

It looks a bit weird to me to have a set of functions to manipulate data on DataStore and some others on the view element.

Anyway, thanks :slight_smile:

Datastore has all basic methods for data manipulations, but it is just not convenient to use view.data.someMethod all the time, so view has wrappers for most common methods. ( calling view.add will call view.data.add inside )

In most cases you need not care about datastore at all and just work with component and its API.

Ok, make sense.

Thanks for explanation :smiley: