check box table fi

This commit is contained in:
Mikhail Chusavitin
2026-01-21 19:13:19 +03:00
parent 74ebea7077
commit 0d9436977e
2 changed files with 46 additions and 13 deletions

View File

@@ -420,8 +420,13 @@ async function selectTable(schema, tableName) {
formatter: "rowSelection", formatter: "rowSelection",
titleFormatter: "rowSelection", titleFormatter: "rowSelection",
hozAlign: "center", hozAlign: "center",
headerHozAlign: "center", // ✅ Выравнивание заголовка
headerSort: false, headerSort: false,
width: 40, width: 40, // ✅ Фиксированная ширина
minWidth: 40, // ✅ Минимальная ширина
maxWidth: 40, // ✅ Максимальная ширина
resizable: false, // ✅ Запрещаем изменение размера
frozen: true, // ✅ Опционально: зафиксировать при прокрутке
cellClick: function(e, cell) { cellClick: function(e, cell) {
e.stopPropagation(); e.stopPropagation();
cell.getRow().toggleSelect(); cell.getRow().toggleSelect();
@@ -562,11 +567,14 @@ async function selectTable(schema, tableName) {
selectableRowsCheck: function(row) { return true; }, selectableRowsCheck: function(row) { return true; },
columns: columns, columns: columns,
layout: "fitDataStretch", // ✅ Изменено - растягивает столбцы для заполнения + подгоняет под данные layout: "fitDataStretch",
resizableColumns: true, resizableColumns: true,
resizableColumnFit: false, resizableColumnFit: false,
columnMinWidth: 100, columnMinWidth: 100, // ✅ Применяется ко всем столбцам кроме явно указанных
columnDefaults: { // ✅ Дефолтные параметры для всех столбцов
resizable: true
},
pagination: true, pagination: true,
paginationMode: "remote", paginationMode: "remote",

View File

@@ -255,7 +255,7 @@
color: #b3e5fc; color: #b3e5fc;
font-style: normal; font-style: normal;
} }
/* ✅ Синхронизация ширины заголовков и столбцов */ /* ✅ Синхронизация ширины заголовков и столбцов */
.tabulator { .tabulator {
border: none; border: none;
background-color: white; background-color: white;
@@ -265,11 +265,6 @@
.tabulator .tabulator-header { .tabulator .tabulator-header {
background-color: #f5f5f5; background-color: #f5f5f5;
border-bottom: 2px solid #ddd; border-bottom: 2px solid #ddd;
overflow: visible !important; /* Важно для синхронизации */
}
.tabulator .tabulator-header .tabulator-col {
background-color: #f5f5f5;
} }
.tabulator .tabulator-tableholder { .tabulator .tabulator-tableholder {
@@ -280,17 +275,47 @@
width: auto !important; width: auto !important;
} }
/* ✅ Минимальная ширина столбцов */ /* ✅ Минимальная ширина столбцов (кроме служебных) */
.tabulator-col { .tabulator-col {
min-width: 100px !important; min-width: 100px !important;
} }
/* ✅ Фиксируем первый столбец с чекбоксами */ /* ✅ ИСКЛЮЧЕНИЕ: столбец с чекбоксами - фиксированная ширина */
.tabulator-col.tabulator-row-handle {
width: 40px !important;
min-width: 40px !important;
max-width: 40px !important;
}
.tabulator-col[tabulator-field=""] { .tabulator-col[tabulator-field=""] {
width: 40px !important; width: 40px !important;
min-width: 40px !important; min-width: 40px !important;
max-width: 40px !important; max-width: 40px !important;
} }
/* ✅ Заголовок столбца с чекбоксами */
.tabulator-header .tabulator-col.tabulator-row-handle,
.tabulator-header .tabulator-col[tabulator-field=""] {
width: 40px !important;
min-width: 40px !important;
max-width: 40px !important;
flex: 0 0 40px !important;
}
/* ✅ Ячейки столбца с чекбоксами */
.tabulator-cell[tabulator-field=""],
.tabulator-row .tabulator-cell:first-child {
width: 40px !important;
min-width: 40px !important;
max-width: 40px !important;
padding: 4px !important;
}
/* ✅ Чекбокс внутри ячейки */
.tabulator-row-handle {
width: 40px !important;
}
</style> </style>
</head> </head>