mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 01:25:36 -05:00
redraw table header (#14963)
This commit is contained in:
@@ -430,6 +430,7 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
||||
this.renderGridDataRowsRange(startIndex, count);
|
||||
});
|
||||
this.dataProvider.dataRows = collection;
|
||||
this.setFilterState();
|
||||
this.table.updateRowCount();
|
||||
await this.setupState();
|
||||
}
|
||||
@@ -525,7 +526,7 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
||||
};
|
||||
this.table.rerenderGrid();
|
||||
}));
|
||||
if (this.configurationService.getValue<boolean>('workbench')['enablePreviewFeatures']) {
|
||||
if (this.enableFilteringFeature) {
|
||||
this.filterPlugin = new HeaderFilter();
|
||||
attachButtonStyler(this.filterPlugin, this.themeService);
|
||||
this.table.registerPlugin(this.filterPlugin);
|
||||
@@ -686,15 +687,25 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
||||
public updateResult(resultSet: ResultSetSummary) {
|
||||
this._resultSet = resultSet;
|
||||
if (this.table && this.visible) {
|
||||
if (this.configurationService.getValue<boolean>('workbench')['enablePreviewFeatures'] && this.options.inMemoryDataProcessing && this.options.inMemoryDataCountThreshold < resultSet.rowCount) {
|
||||
this.filterPlugin.enabled = false;
|
||||
}
|
||||
this.dataProvider.length = resultSet.rowCount;
|
||||
this.setFilterState();
|
||||
this.table.updateRowCount();
|
||||
}
|
||||
this._onDidChange.fire(undefined);
|
||||
}
|
||||
|
||||
private get enableFilteringFeature(): boolean {
|
||||
return this.configurationService.getValue<boolean>('workbench')['enablePreviewFeatures'];
|
||||
}
|
||||
|
||||
private setFilterState(): void {
|
||||
if (this.enableFilteringFeature) {
|
||||
const rowCount = this.table.getData().getLength();
|
||||
this.filterPlugin.enabled = this.options.inMemoryDataProcessing
|
||||
&& (this.options.inMemoryDataCountThreshold === undefined || this.options.inMemoryDataCountThreshold >= rowCount);
|
||||
}
|
||||
}
|
||||
|
||||
private generateContext(cell?: Slick.Cell): IGridActionContext {
|
||||
const selection = this.selectionModel.getSelectedRanges();
|
||||
return <IGridActionContext>{
|
||||
|
||||
Reference in New Issue
Block a user