JSON to object

Hi, I’m trying to fetch and display the names of users using parse… But I can’t get it to work. Here’s what I’ve been doing…

new Parse.Query(users).find().then(function(results){
    for(var i=0;i<results.length;i++){
        myuser[i] = results[i];
    }
}

And in the ux I have…

<StackPanel>
    <Each Items="{myuser}">
        <Text Value="{name}" />
    </Each>
</StackPanel>

This has nothing to do with JSON. To get databinding in to your UX you need to use Observable in your JavaScript.


var Observable = require('FuseJS/Observable');
myuser = Observable();

new Parse.Query(users).find().then(function(results){
  for(var i=0;i<results.length;i++){
    myuser.add(results[i]);
  }
}