Fix row copy selection and table bottom spacing placement

This commit is contained in:
Mikhail Chusavitin
2026-02-04 17:08:10 +03:00
parent 2a41c5fd0a
commit 9dfef30ad7
4 changed files with 28 additions and 7 deletions

View File

@@ -38,6 +38,7 @@
position: relative;
overflow: auto; /* ✅ Разрешаем прокрутку */
min-height: 0;
margin-bottom: 14px;
}
/* ✅ Стили для меню столбцов */
@@ -455,8 +456,6 @@
display: flex;
flex-direction: column;
min-height: 0;
padding-bottom: 16px;
box-sizing: border-box;
}
</style>

View File

@@ -46,8 +46,15 @@ function updateSelectionCounter() {
let count = 0;
if (table) {
const tabulatorSelected = table.getSelectedData();
count = tabulatorSelected.length + selectedRowsDataGlobal.size;
const allSelectedData = new Map();
table.getSelectedData().forEach(rowData => {
const key = getRowKey(rowData);
allSelectedData.set(key, rowData);
});
selectedRowsDataGlobal.forEach((rowData, key) => {
allSelectedData.set(key, rowData);
});
count = allSelectedData.size;
} else {
count = selectedRowsDataGlobal.size;
}

View File

@@ -329,8 +329,15 @@ async function showExportDialog() {
const hasTable = currentSchema && currentTable && table;
let selectedCount = 0;
if (hasTable) {
const tabulatorSelected = table.getSelectedData();
selectedCount = tabulatorSelected.length + selectedRowsDataGlobal.size;
const allSelectedData = new Map();
table.getSelectedData().forEach(rowData => {
const key = getRowKey(rowData);
allSelectedData.set(key, rowData);
});
selectedRowsDataGlobal.forEach((rowData, key) => {
allSelectedData.set(key, rowData);
});
selectedCount = allSelectedData.size;
}
const modal = document.createElement('div');

View File

@@ -454,7 +454,7 @@ async function selectTable(schema, tableName, restoreState = false) {
console.log('🏗️ Создание Tabulator...');
table = new Tabulator("#table", {
selectableRows: false,
selectableRows: true,
selectableRowsPersistence: true,
columns: columns,
layout: "fitDataStretch",
@@ -652,6 +652,14 @@ async function selectTable(schema, tableName, restoreState = false) {
checkbox.checked = row.isSelected();
}
}
const rowData = row.getData();
const key = getRowKey(rowData);
if (row.isSelected()) {
selectedRowsDataGlobal.set(key, rowData);
} else {
selectedRowsDataGlobal.delete(key);
}
});
updateSelectionCounter();
});