Skip to content

Instantly share code, notes, and snippets.

@nelstrom
Created October 18, 2010 18:18
Show Gist options
  • Save nelstrom/632708 to your computer and use it in GitHub Desktop.
Save nelstrom/632708 to your computer and use it in GitHub Desktop.
Creating an XTemplate from an array of strings.
Ext.setup({
onReady: function() {
var data = [{
name: 'Joshua',
age:3
},{
name: 'Matthew',
age:2
},{
name: 'Solomon',
age:0
}
];
var content = new Ext.Panel({
tpl: [
'<p>Kids:</p>',
'<tpl for=".">',
' <p>{#}. {name}</p>',
'</tpl>'
]
});
new Ext.Panel({
fullscreen: true,
items: [content]
});
content.update(data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment