« Back
Sammy.EventContext renderEach ( location, name, data, callback )
Create and return a Sammy.RenderContext calling renderEach() on it.
Loads the template and interpolates the data for each item,
however does not actual place it in the DOM.
Example
// mytemplate.mustache <div class="name">{{name}}</div>
renderEach('mytemplate.mustache', [{name: 'quirkey'}, {name: 'endor'}])
// sets the `content` to <div class="name">quirkey</div><div class="name">endor</div>
renderEach('mytemplate.mustache', [{name: 'quirkey'}, {name: 'endor'}]).appendTo('ul');
// appends the rendered content to $('ul')
comments powered by Disqus