mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 01:25:36 -05:00
Add ModelView method SetItemLayout (#10306)
* Add ModelView method SetItemLayout * Remove extra line break
This commit is contained in:
@@ -352,6 +352,24 @@ export abstract class ContainerBase<T> extends ComponentBase {
|
||||
|
||||
abstract setLayout(layout: any): void;
|
||||
|
||||
public setItemLayout(componentDescriptor: IComponentDescriptor, config: any): void {
|
||||
if (!componentDescriptor) {
|
||||
return;
|
||||
}
|
||||
const item = this.items.find(item => item.descriptor.id === componentDescriptor.id && item.descriptor.type === componentDescriptor.type);
|
||||
if (item) {
|
||||
item.config = config;
|
||||
this.onItemLayoutUpdated(item);
|
||||
this._changeRef.detectChanges();
|
||||
} else {
|
||||
throw new Error(`Unable to set item layout - unknown item ${componentDescriptor.id}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
protected onItemsUpdated(): void {
|
||||
}
|
||||
|
||||
protected onItemLayoutUpdated(item: ItemDescriptor<T>): void {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user