From dbc29568ca64c2d8a53bb086c9c4758bd8dcbcd7 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Sun, 15 Jan 2023 16:34:30 -0800 Subject: [PATCH] Fix table params --- .../playlist-detail-song-list-content.tsx | 1 + .../components/playlist-list-content.tsx | 7 +------ .../songs/components/song-list-content.tsx | 16 +--------------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx b/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx index c92adb54..e0eac5d0 100644 --- a/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx +++ b/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx @@ -197,6 +197,7 @@ export const PlaylistDetailSongListContent = ({ tableRef }: PlaylistDetailConten key={`table-${page.display}-${page.table.rowHeight}-${server?.id}`} ref={tableRef} alwaysShowHorizontalScroll + autoFitColumns={page.table.autoFit} columnDefs={columnDefs} getRowId={(data) => data.data.uniqueId} infiniteInitialRowCount={checkPlaylistList.data?.totalRecordCount || 1} diff --git a/src/renderer/features/playlists/components/playlist-list-content.tsx b/src/renderer/features/playlists/components/playlist-list-content.tsx index 33270f88..54ed13e8 100644 --- a/src/renderer/features/playlists/components/playlist-list-content.tsx +++ b/src/renderer/features/playlists/components/playlist-list-content.tsx @@ -185,13 +185,8 @@ export const PlaylistListContent = ({ tableRef }: PlaylistListContentProps) => { key={`table-${page.display}-${page.table.rowHeight}-${server?.id}`} ref={tableRef} alwaysShowHorizontalScroll - animateRows - maintainColumnOrder - suppressCopyRowsToClipboard - suppressMoveWhenRowDragging - suppressPaginationPanel suppressRowDrag - suppressScrollOnNewData + autoFitColumns={page.table.autoFit} blockLoadDebounceMillis={200} cacheBlockSize={200} cacheOverflowSize={1} diff --git a/src/renderer/features/songs/components/song-list-content.tsx b/src/renderer/features/songs/components/song-list-content.tsx index 2f73ee36..14fc1315 100644 --- a/src/renderer/features/songs/components/song-list-content.tsx +++ b/src/renderer/features/songs/components/song-list-content.tsx @@ -57,14 +57,6 @@ export const SongListContent = ({ itemCount, tableRef }: SongListContentProps) = [page.table.columns], ); - const defaultColumnDefs: ColDef = useMemo(() => { - return { - lockPinned: true, - lockVisible: true, - resizable: true, - }; - }, []); - const onGridReady = useCallback( (params: GridReadyEvent) => { const dataSource: IDatasource = { @@ -180,18 +172,12 @@ export const SongListContent = ({ itemCount, tableRef }: SongListContentProps) = key={`table-${page.display}-${page.table.rowHeight}-${server?.id}`} ref={tableRef} alwaysShowHorizontalScroll - animateRows - maintainColumnOrder - suppressCopyRowsToClipboard - suppressMoveWhenRowDragging - suppressPaginationPanel suppressRowDrag - suppressScrollOnNewData + autoFitColumns={page.table.autoFit} blockLoadDebounceMillis={200} cacheBlockSize={500} cacheOverflowSize={1} columnDefs={columnDefs} - defaultColDef={defaultColumnDefs} enableCellChangeFlash={false} getRowId={(data) => data.data.id} infiniteInitialRowCount={itemCount || 100}