Skip to content

Instantly share code, notes, and snippets.

@alexspeller
Created August 11, 2013 20:53
Show Gist options
  • Save alexspeller/6206798 to your computer and use it in GitHub Desktop.
Save alexspeller/6206798 to your computer and use it in GitHub Desktop.
App.RadioButtonGroup = Em.View.extend
templateName: 'radio_button_group'
classNames: ['radio-group']
groupName: (->
"radiogroup-#{Em.guidFor(@)}"
).property()
change: ->
@set 'value', @$('input:checked').val()
updateSelected: (->
@$("input[value=#{@get('value')}]")[0].checked = true
).observes 'value'
didInsertElement: -> @updateSelected()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment