title: WinJS, data-win-bind for script controlled binding?
body: <p>I'm working on a Windows 8 App in HTML5/Javascript. I created a custom control that uses a stack of DIVs to display content, and each DIV is rendered using <code>WinJS.Binding.Template</code>. The setup is close to the answer in this question: <a href="https://stackoverflow.com/questions/14659952/winjs-ui-listview-customize-list-item-content">WinJS.UI.ListView customize list item content?</a> .</p>
  
  <p>The binding data is close to:</p>
  
  <pre><code>[
      {
          "title": "title name",
          "allow_action": false
          "action_type": "go"
      },
      ...
  ]
  </code></pre>
  
  <p>And my template is close to:</p>
  
  <pre><code>&lt;div id="entry" data-win-control="WinJS.Binding.Template"&gt;
      &lt;div data-win-bind="textContent: title"&gt;
      &lt;/div&gt;
      &lt;a class="action"&gt;Action&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Upon binding, I would like to:</p>
  
  <ol>
  <li>Change the <code>className</code> of <code>a.action</code> based on the value of <code>allow_action</code> and <code>action_type</code>.</li>
  <li>Attach an event (<code>addEventListener</code>) to <code>a.action</code> upon binding, based on the contents of the binding data. This includes <code>allow_action</code>, <code>action_type</code> and other values.</li>
  </ol>
  
  <p>Basically, I wish to have a pre-binding or post-binding callback function, with the element, and bind data as arguments. This doesn't appear to be possible with converters because converter doesn't let you access other fields.</p>
  
  <p>Meanwhile I'm manually processing these things with DOM after <code>render</code>. I'm wondering if there are better options available. Thank you.</p>
  
  <p><strong>Update</strong></p>
  
  <p>As suggested by @GotDibbs and @RSW in the comments, I managed to solve problem #1 using the solution from <a href="https://stackoverflow.com/questions/14713927/sending-multiple-parameters-to-winjs-binding-converter-function/14715804#14715804">Sending multiple parameters to WinJS.Binding.converter() function</a> . I'm wondering if #2 is still possible?</p>