BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi,
Whenever l click on the sidebar menu button (toggle) to view it in full mode (i.e. maximized state) it does not reflect on the panels on the dashboard component. The panels on the dashboad does not change in size. The grid control on customer component do resize to full mode and normal mode. Kindly assist. https://stackblitz.com/edit/angular-3s6d4b-au8hqo?file=app%2Fcustomer-list%2Fcustomer-list.component.ts,app.component.ts
Regards
Charles
Hi Charles,
Greetings from Syncfusion support.
Based on your shared details, we understand that you are facing an issue with the Dashboard Layout component inside the Sidebar component when performing Sidebar toggle actions. Although we were unable to run your shared sample, we have attempted to replicate the problem by creating a sample based on the your sample code. However, we were unable to replicate the issue(Panels not resizing when browser is full screen or restored to normal) at end. For your reference, we have included the sample.
Sample: https://stackblitz.com/edit/angular-d7kvhn?file=src%2Fapp.component.ts
Please check out the shared sample at your end. However, if we misunderstood your exact issue, please share some additional details related to your exact issue like video footage and sample. This will allow us to fully understand your issue and provide a solution that meets your needs.
Regards,
Leo Lavanya Dhanaraj
Hi Leo,
Thank you for your response. From your sample whenever the sidebar is hidden the dashboard layout should be in full screen view i.e. the panels should be wide to fill the space. And when the sidebar is shown the dashboard layout (when in normal view) should also fill the space.
In my sample below the dashboard layout (panels) appear to fill the space in full only when l drag to resize the browser page manually. So l want when l click on the sidebar toggle button it should resize automatic (dashboard layout should fill the space).
See pictures below how l want the Dashboard Layout component inside the Sidebar component to appear. Kindly assist.
Full screen view (sidebar is hidden)
Normal view (sidebar is shown)
Regards
Charles
Charles, We would like to mention that the required scenario occurs because the Dashboard Layout initially takes the entire width of the page and renders the panel. The mentioned issue is also occurring due to the component is not being properly refreshed. To overcome the issue, we suggest you to refresh the Dashboard Layout when changing the states of Sidebar(open and change). Check the below mentioned code snippets and sample for your reference. This helps in the proper alignment of panels based on the Sidebar’s width.
<ejs-sidebar #dockBar id="dockSidebar" [enableDock]="enableDock" [width]="width" [dockSize]="dockSize" (open)="onOpen($event)" (change)="onChange($event)" ></ejs-sidebar>
onOpen() { var parentElement = document.getElementById('dashboardParent'); parentElement.style.width = 'calc(100% - ' + this.dockBar.element.clientWidth + 'px)'; }
onChange() { var parentElement = document.getElementById('dashboardParent'); parentElement.style.width = 'calc(100% - ' + this.dockBar.element.clientWidth + 'px)'; this.dashboard.refresh(); } |
Follow our suggestion and check the shared sample at your end. Please get back to us if you need any further assistance.
Regards,
Leo Lavanya Dhanaraj
Hi Leo,
Thank you for your response. In my sample l was not able to to successfully apply your codes as the sidebar menu are router links. So l want the dashboard layout to fill the space whenever i return to select the dashboard menu from customer menu. kindly assist.
Regards
charles
Hi Charles,
Thanks for your patience.
To meet your requirement, we have included the modified Angular Dashboard Layout sample. In your sample, you had given the column value of 7, but you have only rendered panels for 6 columns. Therefore, the extra space for panel rendering is allocated in your application. To remove the extra space in the Dashboard Layout, we have set the column value as occupied by the panels in the Dashboard and refreshed the component using its instance inside the Dashboard created event.
Check out the below sample and code snippets for your reference.
[dashboard.component.html] <ejs-dashboardlayout id="defaultLayout" #defaultLayout [columns]="columns" [cellSpacing]="cellSpacing" [panels]="panels" (created)="dashboardCreated($event)" > </ejs-dashboardlayout>
[dashboard.component.ts] @ViewChild('defaultLayout') public dashboardIns: DashboardLayoutComponent;
public columns: number = 6;
dashboardCreated() { setTimeout(() => { this.dashboardIns.refresh(); }, 500); } |
Hi LeoLavanya ,
I have check out the modified sample and code snippets that you had supplied but yet it didnt meet my requirement. See video attached of the reported issue. Whenever the sidebar panel is in hidden state then the panels on the dashboard component should get resized and filled the screen and when it's switched on normal mode it should resized to fit on the screen. Kindly assist
Regards
Charles
Charles, Currently, we are checking the mentioned Dashboard refreshment issue in the Angular platform. We need some additional time to check this issue and we will update you with further details by May 12, 2023. We appreciate your patience.
Regards,
Leo Lavanya Dhanaraj
Hi Charles,
Thanks for your patience.
Based on your shared sample, we have validated the mentioned Dashboard refreshment issue in the Angular platform. The reported issue occurs because the Dashboard Layout component not being properly refreshed while navigating to another page using the router. To overcome the reported issue, you need to refresh the Dashboard component using the refresh method.
For your reference, we have included the modified sample. Here, we have called the Dashboard refresh method inside the Sidebar open and close events using the router-outlet active event.
[app.component.html] <div class="control-section" id="reswrapper"> ... <ejs-sidebar id="sideTree" ... (open)="onOpen($event)" (close)="onClose($event)" > ... </ejs-sidebar> <div class="main-sidebar-content" id="main-text"> <div class="sidebar-content"> <router-outlet (activate)="onActivate($event)"></router-outlet> </div> </div> </div>
[app.component.ts] private routerCompRef; public onActivate(componentReference) { this.routerCompRef = componentReference; } onClose() { this.routerCompRef.refreshDashboard(); } onOpen() { this.routerCompRef.refreshDashboard(); }
[dashboard.component.ts] refreshDashboard() { if (this.dashboardIns) { setTimeout(() => { this.dashboardIns.refresh(); }, 500); } } |