Working on ColumnsManager. Added CycleStateControl and DataGridColumnsManager.

This commit is contained in:
2026-01-24 23:55:44 +01:00
parent 3c2c07ebfc
commit 0bd56c7f09
9 changed files with 1080 additions and 103 deletions

View File

@@ -410,6 +410,18 @@ function getCellId(event) {
return {cell_id: null};
}
/**
* Check if the click was on a dropdown button element.
* Used with hx-vals="js:getDropdownExtra()" for Dropdown toggle behavior.
*
* @param {MouseEvent} event - The mouse event
* @returns {Object} Object with is_button boolean property
*/
function getDropdownExtra(event) {
const button = event.target.closest('.mf-dropdown-btn');
return {is_button: button !== null};
}
/**
* Shared utility function for triggering HTMX actions from keyboard/mouse bindings.
* Handles dynamic hx-vals with "js:functionName()" syntax.
@@ -1498,7 +1510,6 @@ function initDataGridMouseOver(gridId) {
}
const wrapper = document.getElementById(`tw_${gridId}`);
const selectionModeDiv = document.getElementById(`tsm_${gridId}`);
// Track hover state
let currentHoverRow = null;
@@ -1512,6 +1523,7 @@ function initDataGridMouseOver(gridId) {
const cell = e.target.closest('.dt2-cell');
if (!cell) return;
const selectionModeDiv = document.getElementById(`tsm_${gridId}`);
const selectionMode = selectionModeDiv?.getAttribute('selection-mode');
if (selectionMode === 'row') {