How to bind a select list with SproutCore 2.0 and Handlebars

Posted by Garth on Stack Overflow See other posts from Stack Overflow or by Garth
Published on 2011-11-23T09:47:42Z Indexed on 2011/11/23 9:50 UTC
Read the original article Hit count: 339

Filed under:
|

Given the following SC.View object:

var view = SC.View.create({
  templateName: 'people',
  people: [],
  selectedPersonId: null});

and the following people Handlebars template:

<select>
  {{#each people}}
  <option {{bindAttr id="id"}}>{{name}}</option>
  {{/each}}
</select>

What would be the best way to bind the selectedPersonId to the select list?

(@stackoverflow: Reputation of 1500+ to create new tags? really?.... #sproutcore20 #handlebars)

© Stack Overflow or respective owner

Related posts about sproutcore

Related posts about handlebars.js