O'Reilly logo

Sencha Touch Cookbook - Second Edition by Ajit Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Basic HTML templating using Template

Template provides a way to create templates using HTML fragments. It contains the HTML elements and various placeholders that are replaced with the values of the fields present in the data that is given to the template API to use in conjunction with the template text. For example, we may have a <div> element present in the body; based on the data, we may add the <ul> and <li> elements to it at runtime.

In this recipe we will look at typical usage of templates and understand what it takes to define and use one.

Getting ready

Make sure that you have set up your development environment by following the recipes outlined in Chapter 1, Gear Up for the Journey.

Create a new folder named ch04 in the same folder in which ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required