(newRow)
| 68 | const colValues = addCols(columns) |
| 69 | |
| 70 | const handleProcessRowUpdate = (newRow) => { |
| 71 | let updatedRows = [] |
| 72 | setRowValues((prevRows) => { |
| 73 | let allRows = [...cloneDeep(prevRows)] |
| 74 | const indexToUpdate = allRows.findIndex((row) => row.id === newRow.id) |
| 75 | if (indexToUpdate >= 0) { |
| 76 | allRows[indexToUpdate] = { ...newRow } |
| 77 | } |
| 78 | updatedRows = allRows |
| 79 | return allRows |
| 80 | }) |
| 81 | onChange(JSON.stringify(updatedRows)) |
| 82 | return newRow |
| 83 | } |
| 84 | |
| 85 | const getEmptyJsonObj = () => { |
| 86 | const obj = {} |