Hi, in my project with Syncfusion I try to use Dashboard
Layout.
I would like to ask about this component. Does the content of the panel
have any limitations? Is it possible to insert for example grid with remote data from
the server?
Kind regards,
<ejs-dialog #devicesDialog
class="devices"
*ngIf="selectedDeviceGenusId && selectedDeviceTypeId" [visible]='false' [target]='targetElement'
allowDragging='true' width='1100px' height='800px' [position]='position' [closeOnEscape]='closeOnEscape'>
<mpt-devices [selectedDeviceGenusId]="selectedDeviceGenusIdShare" [selectedDeviceTypeId]="selectedDeviceTypeIdShare"
(zmfObjectEvent)="receiveZmfObject($event)"></mpt-devices>
</ejs-dialog>
Thank you for your response again. I still have a further question for the dashboard layout component. In my project I want to add and remove panels dynamically. How to implement the panel adding functionality? I have a request to provide an example of a valid 'content' element as in the example below.
My example (incorrect):
public addNewPanelInfoWaiting() {
let panel:
PanelModel[] = [{
'id': 'InfoWaiting', 'sizeX': 1, 'sizeY': 1, 'row': 0, 'col': 0,
content: '<mpt-info-waiting
(deletePanelEvent)=this.deletePanelEventInfoWaiting($event)></mpt-info-waiting>'
}];
this.dashboard.addPanel(panel[0]);
}
deletePanelEvent is EventEmitter in other component.
deletePanelEventInfoWaiting:
public deletePanelEventInfoWaiting($event: MouseEventArgs): void {
this.dashboard.removePanel('infoWaiting');
}
An example from the documentation:
addClick()
{
this.
panel
={
id
:"Panel"+
this.
count
.toString(),
sizeX
:this.
sizeX
.value
,
sizeY
:this.
sizeY
.value
,
row
:this.
row
.value
,
col
:this.
column
.value
,
content
:"<div class='content'>"+
this.
count
+"</div>"
}
this.
dashboard
.addPanel(this.panel
);
this.
count
=this.
count
+1;
(<any>this.
dropDownListObject
.dataSource
).push(this.panel
.id
);
this.
dropDownListObject
.refresh();
};
Thank you for your answer. I have tried to implement the solution and this leads to another question:
Is the version of Syncfusion 17+ required by the previous example? Should I update other elements (such as grid) to have it working with dashboard?
Kind regards,
Grzegorz
Hi Grzegorz,Thank you for providing the code snippet.In that code block, you have tried to render the custom component dynamically through the content template. But, we cannot render a custom component dynamically through the content template. Because, as content property is string type, so we cannot able to parse as it directly renders it as an html element.For dynamically adding panels with components, you can directly specify the corresponding HTML elements specified in custom component.Please let us know, if you have any concern on this.Regards,Ashokkumar B.