| @@ -72,11 +72,17 @@ const ProjectCashFlow: React.FC = () => { | |||||
| ); | ); | ||||
| const handleSelectionChange = (newSelectionModel: GridRowSelectionModel) => { | const handleSelectionChange = (newSelectionModel: GridRowSelectionModel) => { | ||||
| var selection: GridRowSelectionModel = [] | |||||
| if (!isInitializing) { | if (!isInitializing) { | ||||
| setSelectionModel(newSelectionModel); | |||||
| if (newSelectionModel.length > 1) { | |||||
| selection = [newSelectionModel[1]] | |||||
| setSelectionModel(selection) | |||||
| } else { | |||||
| selection = newSelectionModel | |||||
| setSelectionModel(newSelectionModel); | |||||
| } | |||||
| const selectedRowsData = projectData.filter((row: any) => | const selectedRowsData = projectData.filter((row: any) => | ||||
| newSelectionModel.includes(row.id) | |||||
| selection.includes(row.id) | |||||
| ); | ); | ||||
| const projectIdList = selectedRowsData.map((row: any) => row.id); | const projectIdList = selectedRowsData.map((row: any) => row.id); | ||||
| setSelectedProjectIdList(projectIdList); | setSelectedProjectIdList(projectIdList); | ||||