| @@ -102,17 +102,21 @@ const SalaryEffectiveModel: React.FC<SalaryEffectiveModelProps> = ({ open, onClo | |||||
| } | } | ||||
| }; | }; | ||||
| const processRowUpdate = useCallback((newRow: GridRowModel) => { | |||||
| const processRowUpdate = | |||||
| // useCallback( | |||||
| (newRow: GridRowModel) => { | |||||
| console.log(newRow) | console.log(newRow) | ||||
| const updatedRow = { ...newRow, updated: true }; | const updatedRow = { ...newRow, updated: true }; | ||||
| console.log(_rows) | console.log(_rows) | ||||
| if (_rows.length != 0) { | if (_rows.length != 0) { | ||||
| setRows(_rows?.map((row: any) => (row.id === newRow.id ? updatedRow : row))); | |||||
| setRows((prev: any[]) => prev?.map((row: any) => (row.id === newRow.id ? updatedRow : row))); | |||||
| } | } | ||||
| return updatedRow; | return updatedRow; | ||||
| }, [_rows, setValue, setRows]) | |||||
| } | |||||
| // , [_rows, setValue, setRows]) | |||||
| useEffect(()=> { | useEffect(()=> { | ||||
| console.log(_rows) | |||||
| setValue('salaryEffectiveInfo', _rows) | setValue('salaryEffectiveInfo', _rows) | ||||
| }, [_rows]) | }, [_rows]) | ||||