Closed MaxPflueger closed 6 years ago
I tried to copy the remote edit cell example but it does not work. The value to be set is always undefined.
updateDocument = (row, fieldName, value) =>{ const { measurements } = this.state; let rowIdx; const targetRow = measurements.find((prod, i) => { if (prod.date === row.date) { rowIdx = i; return true; } return false; }); if (targetRow) { targetRow[fieldName] = parseInt(value); measurements[rowIdx] = targetRow; this.setState({ measurements }); } }
I tried to copy the remote edit cell example but it does not work. The value to be set is always undefined.
updateDocument = (row, fieldName, value) =>{ const { measurements } = this.state; let rowIdx; const targetRow = measurements.find((prod, i) => { if (prod.date === row.date) { rowIdx = i; return true; } return false; }); if (targetRow) { targetRow[fieldName] = parseInt(value); measurements[rowIdx] = targetRow; this.setState({ measurements }); } }