Created
March 26, 2018 14:29
-
-
Save gustavonecore/1bcb318915329e9743f8fcd930b5349a to your computer and use it in GitHub Desktop.
components/TransactionRowComponent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import SelectField from 'material-ui/SelectField'; | |
import MenuItem from 'material-ui/MenuItem'; | |
export default class TransactionRowComponent extends Component { | |
state = { | |
value:null, | |
} | |
handleChange = (event, index, value) => { | |
this.setState({value}); | |
this.props.onChangeBusinessCenter(this.props.transactionId, value) | |
} | |
render () { | |
let value = !this.state.value ? this.props.businessCenterId : this.state.value; | |
return ( | |
<SelectField | |
value={value} | |
onChange={this.handleChange} | |
> | |
{this.props.businessCenters.map(bc => { | |
return <MenuItem key={bc.id} value={bc.id} primaryText={bc.name} /> | |
})} | |
</SelectField> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment