I have an array which you can see below. How can I insert data from a Selectfield into prints.printMethod?
selectedOrder: {
category: {},
product: {},
brand: {},
prints: {
printMethod: {},
height: '',
width: '',
colors: ''
}
}
My code below is the onChange function. I am not sure if I am missing something. I hope someone can help me.
onBrandingsChange = (event, index, value) => {
var newSelect = this.state.selectedOrder;
newSelect.prints.push(value);
this.setState({selectedOrder: newSelect});
}
<SelectField value={this.state.selectedOrder.prints.printMethod} onChange={this.onBrandingsChange}>
{_.map(this.state.brandings, (b) => {
return <MenuItem value={b.name} primaryText={b.name} key={b.id}/>;
})}
</SelectField>