PDA

View Full Version : Template/JSON object Question



jej2003
30 Apr 2009, 5:19 PM
When using a template to render a JSON object to a panel how can I access public properties of the JSON object?

For instance my JSON object is like:
{Location:{lattitude:0, longitude:0}} how can I make the template render these? I have tried doing something like



var locationTplMarkup = [
'Location: {Location.lattitude}, {Location.longitude}<br/>'
];

to no avail. What is the proper way to reference these properties in the template?

jej2003
30 Apr 2009, 5:32 PM
Found the solution, Xtemplate and



'<tpl for="Location">',
'{lattitude}, {longitude}</br>',
'</tpl>