Ver código fonte

single selection

tags/Baseline_180220205_Frontend
MSI\derek 10 meses atrás
pai
commit
54f5340ccc
1 arquivos alterados com 9 adições e 3 exclusões
  1. +9
    -3
      src/components/ProjectCashFlow/ProjectCashFlow.tsx

+ 9
- 3
src/components/ProjectCashFlow/ProjectCashFlow.tsx Ver arquivo

@@ -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);


Carregando…
Cancelar
Salvar