3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
7 Ext.onReady(function(){
11 company: 'Ext JS, LLC',
12 address: '4 Red Bulls Drive',
28 var p = new Ext.Panel({
29 title: 'Basic Template',
31 html: '<p><i>Apply the template to see results here</i></p>',
33 text: 'Apply Template',
36 var tpl = new Ext.Template(
37 '<p>Name: {name}</p>',
38 '<p>Company: {company}</p>',
39 '<p>Location: {city}, {state}</p>'
42 tpl.overwrite(p.body, data);
43 p.body.highlight('#c3daf9', {block:true});
47 renderTo: document.body
51 var p2 = new Ext.Panel({
54 html: '<p><i>Apply the template to see results here</i></p>',
56 text: 'Apply Template',
59 var tpl = new Ext.XTemplate(
60 '<p>Name: {name}</p>',
61 '<p>Company: {company}</p>',
62 '<p>Location: {city}, {state}</p>',
64 '<tpl for="kids" if="name==\'Jack Slocum\'">',
65 '<tpl if="age > 1"><p>{#}. {parent.name}\'s kid - {name}</p></tpl>',
68 tpl.overwrite(p2.body, data);
69 p2.body.highlight('#c3daf9', {block:true});
73 renderTo: document.body