title: Binding checkboxes using KnockOutJS
body: <p>In my application, there is a section of dynamically loaded 'locations'. The locations are objects, not simple strings (They have a name, id, and other properties). I need to be able to bind to the checked locations, and also want to track which ones are checked in a hidden input, such as storing a comma delimited string of locationId's. </p>
  
  <p>I found a good example of this here:
  <a href="https://stackoverflow.com/questions/6736136/working-with-checkboxes-in-knockoutjs/6737348#6737348">Working with a list of checkboxes in knockoutjs</a></p>
  
  <p>Which led me to this JSFiddle:
  <a href="http://jsfiddle.net/rniemeyer/Jm2Mh/" rel="nofollow noreferrer">http://jsfiddle.net/rniemeyer/Jm2Mh/</a></p>
  
  <p>However when I tried to re-write this using my location objects, it is throwing an error:</p>
  
  <pre><code>Uncaught ReferenceError: Unable to parse bindings. 
  Bindings value: attr: { value: $data }, checked: $item.selections 
  Message: $item is not defined
  </code></pre>
  
  <p>Here is a JSFiddle of what I've done so far. (You can see the error above if press F12 and run it).
  <a href="http://jsfiddle.net/toddhd/BkUUX/3/" rel="nofollow noreferrer">http://jsfiddle.net/toddhd/BkUUX/3/</a></p>
  
  <p>While the error is obvious, $item is not defined, I do not really understand what $item is and why it works in the first example and not in mine.</p>
  
  <p>Thanks for any help you can offer. Bonus points if anyone can help me re-write the code to display the selectedLocations also. :)</p>