mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
select the row on double click (#22456)
* select row on double click * skip row number column
This commit is contained in:
@@ -549,6 +549,7 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
|||||||
this._register(this.dataProvider.onFilterStateChange(() => { this.layout(); }));
|
this._register(this.dataProvider.onFilterStateChange(() => { this.layout(); }));
|
||||||
this._register(this.table.onContextMenu(this.contextMenu, this));
|
this._register(this.table.onContextMenu(this.contextMenu, this));
|
||||||
this._register(this.table.onClick(this.onTableClick, this));
|
this._register(this.table.onClick(this.onTableClick, this));
|
||||||
|
this._register(this.table.onDoubleClick(this.onTableDoubleClick, this));
|
||||||
this._register(this.dataProvider.onFilterStateChange(() => {
|
this._register(this.dataProvider.onFilterStateChange(() => {
|
||||||
const columns = this.table.columns as FilterableColumn<T>[];
|
const columns = this.table.columns as FilterableColumn<T>[];
|
||||||
this.state.columnFilters = columns.filter((column) => column.filterValues?.length > 0).map(column => {
|
this.state.columnFilters = columns.filter((column) => column.filterValues?.length > 0).map(column => {
|
||||||
@@ -767,6 +768,15 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private onTableDoubleClick(event: ITableMouseEvent) {
|
||||||
|
// the first column is already handled by rowNumberColumn plugin.
|
||||||
|
if (event.cell && event.cell.cell !== 0) {
|
||||||
|
// upon double clicking, we want to select the entire row so that it is easier to know which
|
||||||
|
// row is selected when the user needs to scroll horizontally.
|
||||||
|
this.table.grid.setSelectedRows([event.cell.row]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public updateResult(resultSet: ResultSetSummary) {
|
public updateResult(resultSet: ResultSetSummary) {
|
||||||
this._resultSet = resultSet;
|
this._resultSet = resultSet;
|
||||||
if (this.table && this.visible) {
|
if (this.table && this.visible) {
|
||||||
|
|||||||
Reference in New Issue
Block a user