Question

I'm currently developping a little KendoMobile WebApp. My problem is quite simple : Anytime I try to initialize a dataSource by setting an Array as its data option, the dataSource remains empty.

Here is my array (screen from safari dev console) :

console.log("fournisseursArray -> ");
console.log(fournisseursArray); 

fournisseursArray

Now this is the structure of my objects :

enter image description here

In my opinion both seems correct in fact : when I use the objects from the array, it shows me what I want so I guess it works fine.

But if it was that simple, I wouldn't have to be here, so...

This is how I declare my dataSource :

dataSourceMap = new kendo.data.DataSource({
    data: fournisseursArray
});

Finally this is what I get when I put a log on my dataSource :

console.log(dataSourceMap);

enter image description here

If someone knows what is the problem, I'll thanks him greatly to share his knowledge with me

Était-ce utile?

La solution

The Kendo UI data source will remain empty unless you call the read or fetch methods. In short call fetch or read before accessing the data.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top