redraw table header (#14963)

This commit is contained in:
Alan Ren
2021-04-05 10:11:53 -07:00
committed by GitHub
parent 6b855a9776
commit 1dad2f36e3
2 changed files with 30 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ export class HeaderFilter<T extends Slick.SlickData> {
private columnDef!: FilterableColumn<T>;
private buttonStyles?: IButtonStyles;
private disposableStore = new DisposableStore();
public enabled: boolean = true;
private _enabled: boolean = true;
constructor() {
}
@@ -435,4 +435,18 @@ export class HeaderFilter<T extends Slick.SlickData> {
e.preventDefault();
e.stopPropagation();
}
public get enabled(): boolean {
return this._enabled;
}
public set enabled(value: boolean) {
if (this._enabled !== value) {
this._enabled = value;
// force the table header to redraw.
this.grid.getColumns().forEach((column) => {
this.grid.updateColumnHeader(column.id);
});
}
}
}