fix(ui): сохранить имя строки при прокрутке таблицы
This commit is contained in:
1 parent
5fbfc752fb
commit
e0f83bdf42
15 files changed
+59
-12
No files matched your search
@@ -18,6 +18,7 @@ import {
|
||||
DATA_GRID_CELL_PAD,
|
||||
DATA_GRID_CELL_PAD_FIRST,
|
||||
DATA_GRID_CELL_PAD_LAST,
|
||||
DEFAULT_DATA_GRID_LAYOUT,
|
||||
} from "@/components/data-grids/shared/data-grid-layout"
|
||||
import { DataGridSortHeader } from "@/components/data-grids/shared/data-grid-sort-header"
|
||||
import {
|
||||
@@ -79,6 +80,7 @@ function CertificatesDataGrid({ certificates, serverMap, isLoading, emptyTitle =
|
||||
{
|
||||
id: "name",
|
||||
accessorKey: "name",
|
||||
size: 160,
|
||||
header: ({ column }) => (
|
||||
<DataGridSortHeader column={column} title="Сертификат" className="ml-1" />
|
||||
),
|
||||
@@ -97,7 +99,7 @@ function CertificatesDataGrid({ certificates, serverMap, isLoading, emptyTitle =
|
||||
</Button>
|
||||
<div className="min-w-0">
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<span className="shrink-0">{cfg.icon}</span>
|
||||
<span className="hidden sm:inline shrink-0">{cfg.icon}</span>
|
||||
<span className="font-medium text-sm truncate" title={cert.name}>
|
||||
{cert.name}
|
||||
</span>
|
||||
@@ -196,6 +198,7 @@ function CertificatesDataGrid({ certificates, serverMap, isLoading, emptyTitle =
|
||||
},
|
||||
{
|
||||
id: "status",
|
||||
size: 120,
|
||||
accessorKey: "status",
|
||||
header: ({ column }) => <DataGridSortHeader column={column} title="Статус" />,
|
||||
cell: ({ row }) => {
|
||||
@@ -226,7 +229,7 @@ function CertificatesDataGrid({ certificates, serverMap, isLoading, emptyTitle =
|
||||
manualPagination: false,
|
||||
autoResetPageIndex: false,
|
||||
autoResetExpanded: false,
|
||||
initialState: { pagination: { pageIndex: 0, pageSize: 50 } },
|
||||
initialState: { pagination: { pageIndex: 0, pageSize: 50 }, columnPinning: { start: ["name"], end: [] } },
|
||||
data: certificates,
|
||||
columns,
|
||||
getRowId: (row) => row.id,
|
||||
@@ -254,6 +257,7 @@ function CertificatesDataGrid({ certificates, serverMap, isLoading, emptyTitle =
|
||||
<DataGridShell
|
||||
table={table}
|
||||
recordCount={certificates.length}
|
||||
tableLayout={{ ...DEFAULT_DATA_GRID_LAYOUT, columnsPinnable: true }}
|
||||
pagination={certificates.length > 50 || pageSize !== 50}
|
||||
isLoading={isLoading}
|
||||
loadingMode="skeleton"
|
||||
|
||||
Reference in new issue
Block a user