Using a Nested Template
One reason to create an external template is so that you can create nested Repeaters
. Imagine, for example, that you want to create an evil organization chart used by a company that specializes in producing evil (see Figure 7.5).
The JavaScript file in Listing 7.10 contains the data for the org chart. Notice that the data follows a pattern. The data is a list of employees. Each employee can have a minions
property that represents another list of employees. An org chart can be arbitrarily deep.
Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.