Code: Select all
onEditorValueChange = (props, value) => {
let entries= [...this.state.entries];
let index = entries.findIndex(p => p.id === props.rowData.id);
if (index !== -1) {
entries[index][props.field] = value;
}
this.setState({entries: entries});
}
yearEditor = props => {
return <InputText type={"text"}
value={this.state.entries[this.state.entries.findIndex(p => p.id === props.rowData.id)]["year"]}
onChange={(e) => this.onEditorValueChange(props, e.target.value)}/>;
}