The Gallery is deprecated. No new Gallery components may be submitted, and modifying existing components is disabled. For more information please read the Gallery Deprecation blog post. This is a static snapshot of the Gallery for archive purposes.
See 1 more by this user. Created: 02/15/11
Project: YUI 3
License: YUI BSD
YUI Version: 3.3.0
Free for use.
Fast Template will take a set of JSON data, an HTML template on the document and a wrapper node. It will quickly loop over the rows in the data and process the html template for each row populating variables in the HTML template. The variables should be named the same as the key in the data. For example if the key in the data is first_name, your HTML would contain a variable called {first_name}. It will then be replaced with the value of the first_name key.
var myData = [ { 'first_name': 'foo' } ];
var myTemplate = new Y.fastTemplate({
data: mydata,
templateNode: Y.one('#template'),
wrapperNode: Y.one('#wrapper')
});
myTemplate.process();
Subject | Author | Date |
---|---|---|
Using Fasttemplate | Santhosh Nageshwar Rao | 02/18/11 |
Re: Using Fasttemplate | Santhosh Nageshwar Rao | 02/19/11 |
Re: Using Fasttemplate | David Martin | 02/19/11 |
Re: Using Fasttemplate | Santhosh Nageshwar Rao | 02/19/11 |
Re: Using Fasttemplate | David Martin | 02/21/11 |
All code on this site is licensed under the BSD License unless stated otherwise.