Templates

There are two ways how templates can be used. We can have a plain template that doesn’t loop any data. It would look like this:
data: {
	name: 'Anca',
	age: '22',
},
tpl: [
	"name: {name}",
	"age: {age}"
],
Or we could loop the records of store (or any object) in which case we would use
tpl: '<tpl for=".">{name} is {age}</tpl>"
We could generate the data like this:
var data = [];

store.each(function(rec) {
    data.push(rec.getData());
});

You may also like...