PDA

View Full Version : $ symbol in the data object and Ext.XTemplate



jeffj
13 Oct 2010, 7:11 PM
The cash symbol appears to be preventing the template from calling the component from my data oject.




Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {
var timeline = new Ext.Component({
title: 'Timeline',
cls: 'timeline',
scroll: 'vertical',
tpl: [
'<tpl for=".">',
'<div class="tweet">',
'<div class="tweet-content">',
'<p>{data}</p>',
'<tpl for="gd$customProperty[2]">',
'<p>{name}</p>',
'<p>{$t}</p>',
'</tpl>',
'</div>',
'</div>',
'</tpl>'

]
});

Data:


"gd$customProperty":[
{"$t":"Love",
"name":"BusinessName"},
{"$t":"130 Sailfish St, Austin",
"name":"BusinessCitySt"},
{"$t":"78734",
"name":"BusinessStateZip"},
{"$t":"657 678 9087",
"name":"BusinessPhone"},
{"$t":"beachflag.png",
"name":"BusinessIcon"},
{"$t":"Three",
"name":"DealTitle"},
{"$t":"f",
"name":"DealDescription"},
{"$t":"$8.99",
"name":"DealPrice"},
{"$t":"$7.99",
"name":"DealPriceOrg"}]},




When calling "{name}" the correct value shows up but when calling "{$t}" the template does not pick up the object variable. the template treats "{$t}" as html text.




gd$customProperty[2]