Hi Juan,
Greetings from Syncfusion support.
We have checked your reported query to set the initial height of dashboard layout when there is no panel. We would like to let you know that when the panels count is zero, the dashboard layout will consider the rows values equal to columns values and render the layout which will be an empty layout. However, we can achieve your requirement to hide the dashboard element, by adding display CSS property value as none to the dashboard element in the created () event when the panel count is zero. Here you can add the display message based on your requirement.
Refer the below code snippet.
function Created () {
var dashboard = document.getElementById("dashboard_default").ej2_instances[0];
if (dashboard.panels.length == 0) {
dashboard.element.classList.add("e-hide");
}
}
<style>
.e-hide {
display: none !important;
}
</style> | |
For your reference, we have prepared a sample with the above-mentioned solution and attached it below. Here, we have added a class to the dashboard layout element while panels count is zero and set display CSS property value none for the added class. Here , during button click we remove the class while a panel is added.
Please let us know, if you have any concerns.
Regards,
Keerthana.