O'Reilly logo

Sencha Touch Cookbook 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 the HTML fragments. It contains HTML elements and various placeholders which 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 and, based on the data, we may add <ul> and <li> elements to it at runtime.

In this recipe, we will look at a typical usage of template 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 Gear up for the Journey recipe outlined in Chapter 1.

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

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