AddPanelClick() {
// adding panel dynamically
let panel: PanelModel[] = [{
id: "layout_" + this.count.toString(),
'sizeX': 4, 'sizeY': 2, 'row': 2, 'col': 0,
}];
this.Dashboard.addPanel(panel[0]);
//rendes the (CustomTemplate) temaplte in dom
const templateValue = this.CustomTemplate.createEmbeddedView(null);
// inserts the template into the view container
this.viewContainer.insert(templateValue);
// Obtaining the content element of the panel
let panel_Content = document.getElementById("layout_" + this.count.toString() + "_content");
// appending the template to the panel content element.
panel_Content.appendChild(templateValue.rootNodes[0]);
this.count++;
} |