mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 01:25:38 -05:00
fixed several model view issues (#1640)
* fixed several model view issues
This commit is contained in:
@@ -127,13 +127,19 @@ export default class TableComponent extends ComponentBase implements IComponent,
|
||||
/// IComponent implementation
|
||||
|
||||
public layout(): void {
|
||||
this._table.layout(new Dimension(
|
||||
this.width ? this.width : getContentWidth(this._inputContainer.nativeElement),
|
||||
this.height ? this.height : getContentHeight(this._inputContainer.nativeElement)));
|
||||
this.layoutTable();
|
||||
|
||||
this._changeRef.detectChanges();
|
||||
}
|
||||
|
||||
private layoutTable(): void {
|
||||
let width: number = this.convertSizeToNumber(this.width);
|
||||
let height: number = this.convertSizeToNumber(this.height);
|
||||
this._table.layout(new Dimension(
|
||||
width && width > 0 ? width : getContentWidth(this._inputContainer.nativeElement),
|
||||
height && height > 0 ? height : getContentHeight(this._inputContainer.nativeElement)));
|
||||
}
|
||||
|
||||
public setLayout(): void {
|
||||
// TODO allow configuring the look and feel
|
||||
this.layout();
|
||||
@@ -149,10 +155,8 @@ export default class TableComponent extends ComponentBase implements IComponent,
|
||||
if (this.selectedRows) {
|
||||
this._table.setSelectedRows(this.selectedRows);
|
||||
}
|
||||
this._table.layout(new Dimension(
|
||||
this.width ? this.width : getContentWidth(this._inputContainer.nativeElement),
|
||||
this.height ? this.height : getContentHeight(this._inputContainer.nativeElement)));
|
||||
|
||||
this.layoutTable();
|
||||
this.validate();
|
||||
}
|
||||
|
||||
@@ -181,20 +185,4 @@ export default class TableComponent extends ComponentBase implements IComponent,
|
||||
public set selectedRows(newValue: number[]) {
|
||||
this.setPropertyFromUI<sqlops.TableComponentProperties, number[]>((props, value) => props.selectedRows = value, newValue);
|
||||
}
|
||||
|
||||
public get height(): number {
|
||||
return this.getPropertyOrDefault<sqlops.TableComponentProperties, number>((props) => props.height, undefined);
|
||||
}
|
||||
|
||||
public set height(newValue: number) {
|
||||
this.setPropertyFromUI<sqlops.TableComponentProperties, number>((props, value) => props.height = value, newValue);
|
||||
}
|
||||
|
||||
public get width(): number {
|
||||
return this.getPropertyOrDefault<sqlops.TableComponentProperties, number>((props) => props.width, undefined);
|
||||
}
|
||||
|
||||
public set width(newValue: number) {
|
||||
this.setPropertyFromUI<sqlops.TableComponentProperties, number>((props, value) => props.width = value, newValue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user