Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export const EquipmentTable: FunctionComponent<EquipmentTableProps> = ({
<>
<CustomAGGrid
ref={gridRef}
rowData={rowData}
rowSelection={{ mode: 'singleRow', checkboxes: false, enableClickSelection: true }}
getRowId={getRowId}
debounceVerticalScrollbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ export const SpreadsheetContent = memo(
const nodesIds = useSelector((state: AppState) => state.spreadsheetNetwork.nodesIds);
const { fetchNodesEquipmentData } = useFetchEquipment();

// Reset isGridReady when the grid is unmounted (disabled=true), so a fresh
// false → true transition on remount re-triggers effects depending on it.
useEffect(() => {
if (disabled) {
setIsGridReady(false);
}
}, [disabled]);

// Initial data loading for this type when the tab is opened
useEffect(() => {
if (active && nodesIds.length > 0 && !equipments.isInitialized && !equipments.isFetching) {
Expand Down Expand Up @@ -172,12 +180,6 @@ export const SpreadsheetContent = memo(
);
}, [equipments, currentNode.id, nodeAliases]);

useEffect(() => {
if (gridRef.current?.api) {
gridRef.current.api.setGridOption('rowData', transformedRowData);
}
}, [transformedRowData, gridRef, isGridReady]);

const filters = useSelector<AppState, FilterConfig[] | undefined>((state) =>
getColumnFiltersFromState(state, TableType.Spreadsheet, tableDefinition?.uuid)
);
Expand Down
Loading