ag-grid
Version:
Advanced Javascript Datagrid. Supports raw Javascript, AngularJS 1.x, AngularJS 2.0 and Web Components
43 lines (34 loc) • 1.02 kB
text/typescript
module ag.grid {
export class VerticalStack {
isLayoutPanel: any;
childPanels: any;
eGui: any;
constructor() {
this.isLayoutPanel = true;
this.childPanels = [];
this.eGui = document.createElement('div');
this.eGui.style.height = '100%';
}
addPanel(panel: any, height: any) {
var component: any;
if (panel.isLayoutPanel) {
this.childPanels.push(panel);
component = panel.getGui();
} else {
component = panel;
}
if (height) {
component.style.height = height;
}
this.eGui.appendChild(component);
}
getGui() {
return this.eGui;
}
doLayout() {
for (var i = 0; i < this.childPanels.length; i++) {
this.childPanels[i].doLayout();
}
}
}
}