[AURORA-1060] - Вирутальный рендеринг
This commit is contained in:
parent
e0dc613c3c
commit
43703866aa
@ -65,7 +65,7 @@ const RealtimeTable = ({ formType, formId, sheetName, direction }) => {
|
|||||||
const { headerPortalRef, containerRef } = useHeaderPortal();
|
const { headerPortalRef, containerRef } = useHeaderPortal();
|
||||||
|
|
||||||
const { sizeMult, setSizeMult, tableScaleStyle, tableWrapperStyle } =
|
const { sizeMult, setSizeMult, tableScaleStyle, tableWrapperStyle } =
|
||||||
useTableScale(containerRef);
|
useTableScale();
|
||||||
|
|
||||||
const [columnsConfig, setColumnsConfig] = useState(null);
|
const [columnsConfig, setColumnsConfig] = useState(null);
|
||||||
|
|
||||||
@ -125,11 +125,19 @@ const RealtimeTable = ({ formType, formId, sheetName, direction }) => {
|
|||||||
columns,
|
columns,
|
||||||
data: data,
|
data: data,
|
||||||
enableRowVirtualization: true,
|
enableRowVirtualization: true,
|
||||||
|
enableColumnVirtualization: true,
|
||||||
rowVirtualizerOptions: {
|
rowVirtualizerOptions: {
|
||||||
overscan: 50,
|
overscan: 30,
|
||||||
scrollPaddingStart: 0,
|
scrollPaddingStart: 0,
|
||||||
scrollPaddingEnd: 0,
|
scrollPaddingEnd: 0,
|
||||||
},
|
},
|
||||||
|
columnVirtualizerOptions: ({ table }) => ({
|
||||||
|
overscan: 5,
|
||||||
|
measureElement: (el) => {
|
||||||
|
const index = Number(el?.getAttribute?.('data-index'));
|
||||||
|
return table.getVisibleLeafColumns()[index]?.getSize() ?? 0;
|
||||||
|
},
|
||||||
|
}),
|
||||||
enableRowSelection: true,
|
enableRowSelection: true,
|
||||||
onRowSelectionChange: setRowSelection,
|
onRowSelectionChange: setRowSelection,
|
||||||
onColumnSizingChange: setColumnSizing,
|
onColumnSizingChange: setColumnSizing,
|
||||||
@ -147,14 +155,9 @@ const RealtimeTable = ({ formType, formId, sheetName, direction }) => {
|
|||||||
expanded: true
|
expanded: true
|
||||||
},
|
},
|
||||||
meta: tableMeta,
|
meta: tableMeta,
|
||||||
muiTableHeadCellProps: ({ column }) => ({
|
muiTableHeadCellProps: {
|
||||||
sx: {
|
sx: { boxSizing: 'border-box' },
|
||||||
width: column.getSize(),
|
},
|
||||||
minWidth: column.getSize(),
|
|
||||||
maxWidth: column.getSize(),
|
|
||||||
boxSizing: 'border-box',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
muiTableBodyCellProps: getTableHeadCellStyles,
|
muiTableBodyCellProps: getTableHeadCellStyles,
|
||||||
muiTableHeadProps: {
|
muiTableHeadProps: {
|
||||||
sx: {
|
sx: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user