title: How to attach data to jquery tmpl
body: <p>Does anyone know how to attach the data item used to render a jQuery template to the resultant  dom object?</p>
  
  <p>given this tmpl:</p>
  
  <pre><code>&lt;script id="sectionTemplate" type="text/x-jquery-tmpl"&gt;
  &lt;div class="story-writer-section sticker ${CssClasses}"&gt;
      &lt;div class="title"&gt;
      &lt;div class="delete-button sticker-button"/&gt;
          ${SectionName}
      &lt;/div&gt;
      &lt;div class="story-writer-story-container"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>and this :</p>
  
  <pre><code>    $("#sectionTemplate")
          .tmpl(sections)
          .appendTo(".story-writer-section-container");
  </code></pre>
  
  <p>I'd like to attach each section to the result via a .data('section', data) so that I can access all the data later on because not all the data is rendered, eg id's etc that I need to get hold of later when doing things like delete.</p>
  
  <p>Perhaps something like this...</p>
  
  <pre><code>        $("#sectionTemplate")
          .tmpl(sections)
          .appendTo(".story-writer-section-container").each(function (????) { 
                                 this.data('section', ?????); 
                            });
  </code></pre>
  
  <p>But I have no idea how to get hold of the current data item used to render this tmpl.</p>
  
  <p>Perhpas there is a way to include this in the template itself?</p>
  
  <p>Any help much appreciated.</p>