Browse Source

single selection

tags/Baseline_180220205_Frontend
MSI\derek 10 months ago
parent
commit
54f5340ccc
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      src/components/ProjectCashFlow/ProjectCashFlow.tsx

+ 9
- 3
src/components/ProjectCashFlow/ProjectCashFlow.tsx View File

@@ -72,11 +72,17 @@ const ProjectCashFlow: React.FC = () => {
);

const handleSelectionChange = (newSelectionModel: GridRowSelectionModel) => {
var selection: GridRowSelectionModel = []
if (!isInitializing) {
setSelectionModel(newSelectionModel);
if (newSelectionModel.length > 1) {
selection = [newSelectionModel[1]]
setSelectionModel(selection)
} else {
selection = newSelectionModel
setSelectionModel(newSelectionModel);
}
const selectedRowsData = projectData.filter((row: any) =>
newSelectionModel.includes(row.id)
selection.includes(row.id)
);
const projectIdList = selectedRowsData.map((row: any) => row.id);
setSelectedProjectIdList(projectIdList);


Loading…
Cancel
Save