jam-cloud/web/app/assets/javascripts/react-components/InstrumentCheckBoxList.js.j...

26 lines
713 B
CoffeeScript
Raw Permalink Normal View History

context = window
rest = window.JK.Rest()
logger = context.JK.logger
@InstrumentCheckBoxList = React.createClass({
2016-01-04 23:25:29 +00:00
mixins: [Reflux.listenTo(@InstrumentStore,"onInstrumentsChanged")]
2016-01-28 19:55:17 +00:00
propTypes: {
onItemChanged: React.PropTypes.func.isRequired
}
getDefaultProps: () ->
selectedInstruments: []
2016-01-04 23:25:29 +00:00
getInitialState: () ->
{instruments: []}
onInstrumentsChanged: (instruments) ->
@setState({instruments: instruments})
render: () ->
`<div className="InstrumentCheckBoxList react-component">
2016-01-04 23:25:29 +00:00
<CheckBoxList objectName='instruments' onItemChanged={this.props.onItemChanged} sourceObjects={this.state.instruments} selectedObjects={this.props.selectedInstruments}/>
</div>`
})