We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Any way to constrain a dashboard layout?

Good Morning:

I have a dashboard layout nested in another dashboard layout.

Is it possible to limit the resizing of the nested layout so that items stay within their panel?

In the below example, I do not want "dashboard_layout" to exceed the boundaries of "dashboard_default"


<div>
    <!--  DashboardLayout element declaration -->
    <ejs-dashboardlayout id="dashboard_default" columns="6" draggableHandle=".e-panel-header" cellSpacing="@Model.CellSpacing">
        <e-dashboardlayout-panels>
            <e-dashboardlayout-panel id="Panel1" sizeX="3" sizeY="2" row="0" col="3" header="<div class='header'>Last year sales comparison</div>" content="<div id='dashboard_layout'></div>">
            </e-dashboardlayout-panel>
        </e-dashboardlayout-panels>
    </ejs-dashboardlayout>
    <!-- end of dashboardlayout element -->
</div>

<div id="column">
    <ejs-dashboardlayout id="dashboard_layout" columns="5" cellSpacing="@Model.ChildCellSpacing" allowResizing="true" >
        <e-dashboardlayout-panels>
            <e-dashboardlayout-panel sizeX="1" sizeY="1" row="0" col="0" content="<div>0</div>">
            </e-dashboardlayout-panel>
            <e-dashboardlayout-panel sizeX="3" sizeY="2" row="0" col="1" content="<div>1</div>">
            </e-dashboardlayout-panel>
            <e-dashboardlayout-panel sizeX="1" sizeY="3" row="0" col="4" content="<div>2</div>">
            </e-dashboardlayout-panel>
            <e-dashboardlayout-panel sizeX="1" sizeY="1" row="1" col="0" content="<div>3</div>">
            </e-dashboardlayout-panel>
            <e-dashboardlayout-panel sizeX="2" sizeY="1" row="2" col="0" content="<div>4</div>">
            </e-dashboardlayout-panel>
            <e-dashboardlayout-panel sizeX="1" sizeY="1" row="2" col="2" content="<div>5</div>">
            </e-dashboardlayout-panel>
            <e-dashboardlayout-panel sizeX="1" sizeY="1" row="2" col="3" content="<div>6</div>">
            </e-dashboardlayout-panel>
        </e-dashboardlayout-panels>
    </ejs-dashboardlayout>
</div>


Thanks in advance.

Doug Kuchna






1 Reply

AB Ashokkumar Balasubramanian Syncfusion Team August 27, 2019 10:36 AM UTC

Hi doug kuchna, 
 
Good day to you. 
 
We have analyzed your query to restrain the nested dashboard panels within the parent dashboards panel element. In Dashboard layout, we have restricted the panel flow in the horizontal direction alone. This is because in vertical direction, the number rows in the Dashboard layout component is unpredictable and may change dynamically during resizing or dragging the panels, so the height of the component cannot be restrained from the component side. However, you can achieve your requirement by setting the overflow-y: auto CSS for the panel within which the inner dashboard is rendered to restrict the panels flow within the parent panel element. 
 
Refer the below code snippet for CSS styles. 
 
<style> 
    #Panel1 { 
        overflow-y: auto; 
    } 
</style> 
 
Here, we have prepared a sample for your reference. 
 
 
Please check the above sample and get back to us if you need any further assistance on this. 
 
Regards, 
Ashokkumar B. 


Loader.
Live Chat Icon For mobile
Up arrow icon