Hello folks, This is my first post.
I'm really new in programming but I'm studying a lot ^^ I think qooxdoo is
amazing! I'm en loved with the tool! hahahaha
I'm studying how to use data binding to my GUI right now, but i have this
situation, 

My JSON:
{ "persons" : 
   [ 
      {"name": "Jonas", "location": "Brasil"} 
      {**various objects**}
   ]
}

I need to bind this data to a list, I've could bind the "name" or the
"location" alone, but i need to add it in the format: "name" - "location"
like "Jonas - Brasil" .

To be honest i found a way of doing it:

var data = new qx.data.store.Json("mydata/url")

data.addListener("loaded", function(e){
  var controller = new qx.data.controller.List(null, list, "name");
  data.bind("model.persons", controller, "model");
  var x = 0;
  var arrayPersons = data.getModel().getLocation();
  
  controller.setLabelOptions({converter : function(data) {
  return data+" - "+arrayPersons.getItem(x++).getNome().toString();
  }});
});

It works, but it doesn't fells right. xD
There's a better way of doing it? I'm stuck on geting it better for a long
time! i would aprecciate help.

Thanks! 
-- 
View this message in context: 
http://qooxdoo.678.n2.nabble.com/How-to-concat-JSON-s-data-in-a-String-tp5876788p5876788.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to