mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
remove updating row number column size (#3756)
This commit is contained in:
@@ -15,7 +15,6 @@ const sizePerDigit = 15;
|
|||||||
export class RowNumberColumn<T> implements Slick.Plugin<T> {
|
export class RowNumberColumn<T> implements Slick.Plugin<T> {
|
||||||
private handler = new Slick.EventHandler();
|
private handler = new Slick.EventHandler();
|
||||||
private grid: Slick.Grid<T>;
|
private grid: Slick.Grid<T>;
|
||||||
private currentColumnWidth: number;
|
|
||||||
|
|
||||||
constructor(private options: IRowNumberColumnOptions) {
|
constructor(private options: IRowNumberColumnOptions) {
|
||||||
}
|
}
|
||||||
@@ -50,23 +49,14 @@ export class RowNumberColumn<T> implements Slick.Plugin<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateRowCount(rowNum: number) {
|
|
||||||
this.options.numberOfRows = rowNum;
|
|
||||||
let columnWidth = Math.max(this.options.numberOfRows.toString().length * sizePerDigit, 22);
|
|
||||||
if (columnWidth !== this.currentColumnWidth) {
|
|
||||||
this.grid.setColumnWidths([this.getColumnDefinition()]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public getColumnDefinition(): Slick.Column<T> {
|
public getColumnDefinition(): Slick.Column<T> {
|
||||||
// that smallest we can make it is 22 due to padding and margins in the cells
|
// that smallest we can make it is 22 due to padding and margins in the cells
|
||||||
this.currentColumnWidth = Math.max(this.options.numberOfRows.toString().length * sizePerDigit, 22);
|
|
||||||
return {
|
return {
|
||||||
id: 'rowNumber',
|
id: 'rowNumber',
|
||||||
name: '',
|
name: '',
|
||||||
field: 'rowNumber',
|
field: 'rowNumber',
|
||||||
width: this.currentColumnWidth,
|
width: 22,
|
||||||
resizable: false,
|
resizable: true,
|
||||||
cssClass: this.options.cssClass,
|
cssClass: this.options.cssClass,
|
||||||
focusable: false,
|
focusable: false,
|
||||||
selectable: false,
|
selectable: false,
|
||||||
|
|||||||
@@ -653,7 +653,6 @@ class GridTable<T> extends Disposable implements IView {
|
|||||||
this.dataProvider.length = resultSet.rowCount;
|
this.dataProvider.length = resultSet.rowCount;
|
||||||
this.table.updateRowCount();
|
this.table.updateRowCount();
|
||||||
}
|
}
|
||||||
this.rowNumberColumn.updateRowCount(resultSet.rowCount);
|
|
||||||
this._onDidChange.fire();
|
this._onDidChange.fire();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user