fix the grid goes blank issue (#20209)

This commit is contained in:
Alan Ren
2022-07-29 18:12:02 -07:00
committed by GitHub
parent afe1b4392f
commit 67ecd6d3d9
3 changed files with 2 additions and 16 deletions

View File

@@ -358,7 +358,6 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
private _state: GridTableState;
private scrolled = false;
private visible = false;
private rowHeight: number;
@@ -450,8 +449,6 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
);
this.dataProvider.dataRows = collection;
this.table.updateRowCount();
// when we are removed slickgrid acts badly so we need to account for that
this.scrolled = false;
}
// actionsOrientation controls the orientation (horizontal or vertical) of the actionBar
@@ -520,8 +517,6 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
this._register(this.dataProvider.onFilterStateChange(() => { this.layout(); }));
this._register(this.table.onContextMenu(this.contextMenu, this));
this._register(this.table.onClick(this.onTableClick, this));
//This listener is used for correcting auto-scroling when clicking on the header for reszing.
this._register(this.table.onHeaderClick(this.onHeaderClick, this));
this._register(this.dataProvider.onFilterStateChange(() => {
const columns = this.table.columns as FilterableColumn<T>[];
this.state.columnFilters = columns.filter((column) => column.filterValues?.length > 0).map(column => {
@@ -582,10 +577,6 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
// so ignore those events
return;
}
if (!this.scrolled && (this.state.scrollPositionY || this.state.scrollPositionX) && isInDOM(this.container)) {
this.scrolled = true;
this.restoreScrollState();
}
if (this.state && isInDOM(this.container)) {
this.state.scrollPositionY = data.scrollTop;
this.state.scrollPositionX = data.scrollLeft;
@@ -664,11 +655,6 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
this._state = val;
}
private onHeaderClick(event: ITableMouseEvent) {
//header clicks must be accounted for as they force the table to scroll to the top;
this.scrolled = false;
}
private async getRowData(start: number, length: number): Promise<ICellValue[][]> {
let subset;
if (this.dataProvider.isDataInMemory) {