export DateSelector, fix issue about column.align and filter panel position of the last header cell.
This commit is contained in:
@ -975,6 +975,11 @@ export class Grid {
|
||||
th.addEventListener('mousedown', e => this._onDragStart(e, col));
|
||||
}
|
||||
const wrapper = createElement('div');
|
||||
if (col.align === 'right') {
|
||||
wrapper.style.justifyContent = 'flex-end';
|
||||
} else if (col.align === 'center') {
|
||||
wrapper.style.justifyContent = 'center';
|
||||
}
|
||||
th.appendChild(wrapper);
|
||||
if (!this.readonly && col.enabled !== false && col.allcheck && isCheckbox) {
|
||||
const check = createCheckbox({
|
||||
@ -1239,6 +1244,8 @@ export class Grid {
|
||||
const style = col.styleFilter(item);
|
||||
if (style != null) {
|
||||
type.setStyle(element, style);
|
||||
} else {
|
||||
element.style.cssText = '';
|
||||
}
|
||||
}
|
||||
if (col.events != null) {
|
||||
@ -1562,7 +1569,12 @@ export class Grid {
|
||||
const th = filter.parentElement;
|
||||
const width = th.offsetWidth;
|
||||
panel.style.top = `${th.offsetHeight + this._var.el.scrollTop}px`;
|
||||
panel.style.left = (th.offsetLeft + (width > FilterPanelWidth ? width - FilterPanelWidth : 0)) + 'px';
|
||||
const offsetLeft = th.offsetLeft;
|
||||
const totalWidth = th.parentElement.offsetWidth;
|
||||
const left = offsetLeft + FilterPanelWidth > totalWidth ?
|
||||
totalWidth - FilterPanelWidth :
|
||||
offsetLeft + (width > FilterPanelWidth ? width - FilterPanelWidth : 0);
|
||||
panel.style.left = `${left}px`;
|
||||
|
||||
// search
|
||||
let searchbox;
|
||||
|
Reference in New Issue
Block a user