mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 09:35:36 -05:00
fix result selection summary issues (#15245)
This commit is contained in:
@@ -654,17 +654,25 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
||||
}
|
||||
|
||||
private async notifyTableSelectionChanged() {
|
||||
const selectedValues = [];
|
||||
const selectedCells = [];
|
||||
for (const range of this.state.selection) {
|
||||
const subset = await this.gridDataProvider.getRowData(range.fromRow, range.toRow - range.fromRow + 1);
|
||||
subset.rows.forEach(row => {
|
||||
let subset;
|
||||
if (this.dataProvider.isDataInMemory) {
|
||||
// handle the scenario when the data is sorted/filtered,
|
||||
// we need to use the data that is being displayed
|
||||
const data = await this.dataProvider.getRangeAsync(range.fromRow, range.toRow - range.fromRow + 1);
|
||||
subset = data.map(item => Object.keys(item).map(key => item[key]));
|
||||
} else {
|
||||
subset = (await this.gridDataProvider.getRowData(range.fromRow, range.toRow - range.fromRow + 1)).rows;
|
||||
}
|
||||
subset.forEach(row => {
|
||||
// start with range.fromCell -1 because we have row number column which is not available in the actual data
|
||||
for (let i = range.fromCell - 1; i < range.toCell; i++) {
|
||||
selectedValues.push(row[i]?.displayValue);
|
||||
selectedCells.push(row[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.queryModelService.notifyCellSelectionChanged(selectedValues);
|
||||
this.queryModelService.notifyCellSelectionChanged(selectedCells);
|
||||
}
|
||||
|
||||
private onTableClick(event: ITableMouseEvent) {
|
||||
@@ -761,7 +769,8 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
||||
dataWithSchema[this.columns[i].field] = {
|
||||
displayValue: r[i - 1].displayValue,
|
||||
ariaLabel: escape(r[i - 1].displayValue),
|
||||
isNull: r[i - 1].isNull
|
||||
isNull: r[i - 1].isNull,
|
||||
invariantCultureDisplayValue: r[i - 1].invariantCultureDisplayValue
|
||||
};
|
||||
}
|
||||
return dataWithSchema as T;
|
||||
|
||||
Reference in New Issue
Block a user