if (typeof response == "object") {
store = new dojo.data.ItemFileReadStore({
data : response
});
console.warn("Loaded to Store");
var itemArray = new Array();
var completed = function(items) {
for(var i = 0; i < items.length; i++) {
console.log(store.getValue(items[i],"itemlabel"));
itemArray.push(store.getValue(items[i]));
}
};
var error = function() {
console.log("Error in fetching data from Store");
};
store.fetch({onComplete: completed, onError: error});
console.warn("Item count"+ itemArray.length);
Despite the above code, my Item Count always ends up being 0.
console.log(store.getValue(items[i],"itemlabel"));
In the callback method, the value above is printed.
If I need to populate my itemArray
, what should I do?