change: sample structure

fix: tooltip of some readonly column in editing mode
feature: adapt filter panel's height
This commit is contained in:
2024-03-07 17:16:37 +08:00
parent 168cae3ce1
commit e75e763938
12 changed files with 36 additions and 11 deletions

@@ -3311,6 +3311,12 @@ export class Grid {
totalWidth - FilterPanelWidth :
offsetLeft + (width > FilterPanelWidth ? width - FilterPanelWidth : 0);
panel.style.left = `${left}px`;
const maxHeight = this._var.el.offsetHeight - this._var.headerHeight;
if (maxHeight < 300) {
panel.style.height = `${maxHeight}px`;
} else {
panel.style.height = '';
}
// search
let searchbox;
@@ -3810,8 +3816,14 @@ export class Grid {
// sub ui-grid
return;
}
const col = target.dataset.col;
const row = target.dataset.row;
if (this._var.virtualRows[row]?.editing) {
if (holder.dataset.row === row &&
holder.dataset.col === col) {
return;
}
const type = this._var.colTypes[this.columns[col]?.key];
if (type?.canEdit && this._var.virtualRows[row]?.editing) {
delete holder.dataset.row;
delete holder.dataset.col;
if (holder.classList.contains('active')) {
@@ -3819,12 +3831,6 @@ export class Grid {
}
return;
}
const col = target.dataset.col;
if (holder.dataset.row === row &&
holder.dataset.col === col) {
return;
}
const type = this._var.colTypes[this.columns[col]?.key];
let element = target.children[0];
if (type != null && typeof type.getElement === 'function') {
element = type.getElement(element);