Panels disappear after being moved

Hi there

I have a component that contains a Dashboard Layout with 3 static panels. The panels can be resized, and repositioned.

The structure is this: 

  • Parent
  • ComponentLayout (contains dashboard layout)
  • ComponentNav (contains TreeView)

As long as Panels are not repositioned, things work fine.
As soon as Panels are repositioned, the last 2 disappear, when  the component's parameters are changed from the Parent. The grid also disappears.

Here is the definition:

 <SfDashboardLayout @ref="@TheDashboardLayout" Columns="15" CellAspectRatio="2" CellSpacing="@(new double[]{10 ,10 })"
                               AllowDragging="true" ShowGridLines="true" AllowResizing="true" DraggableHandle=".e-panel-header">
                @*<DashboardLayoutEvents OnDragStop="OnDragStopped" OnResizeStop="OnResizeStopped"  Changed="OnLayoutChanged"></DashboardLayoutEvents>*@
                <DashboardLayoutEvents OnDragStop="OnDragStopped" OnResizeStop="OnResizeStopped"  ></DashboardLayoutEvents>
                <DashboardLayoutPanels>
                    <DashboardLayoutPanel Id="@nameof(EditorState.Layout.MediaPanel)"
                                          SizeX="@EditorState.Layout.MediaPanel.SizeX"
                                          SizeY="@EditorState.Layout.MediaPanel.SizeY"
                                          MinSizeX="@EditorState.Layout.MediaPanel.MinSizeX"
                                          MinSizeY="@EditorState.Layout.MediaPanel.MinSizeY"
                                          Row="@EditorState.Layout.MediaPanel.Row"
                                          Col="@EditorState.Layout.MediaPanel.Col"
                                          MaxSizeX="@EditorState.Layout.MediaPanel.MaxSizeX"
                                          MaxSizeY="@EditorState.Layout.MediaPanel.MaxSizeY">
                        <HeaderTemplate><div>Media</div></HeaderTemplate>
                        <ContentTemplate>
                            <div class="p-1 w-100 h-100 overflow-auto">
                            <h2>
                                Stuff 1
                            </h2>
                            </div>
                        </ContentTemplate>
                    </DashboardLayoutPanel>
                    <DashboardLayoutPanel Id="@nameof(EditorState.Layout.TextPanel)"
                                          SizeX="@EditorState.Layout.TextPanel.SizeX"
                                          SizeY="@EditorState.Layout.TextPanel.SizeY"
                                          MinSizeX="@EditorState.Layout.TextPanel.MinSizeX"
                                          MinSizeY="@EditorState.Layout.TextPanel.MinSizeY"
                                          Row="@EditorState.Layout.TextPanel.Row"
                                          Col="@EditorState.Layout.TextPanel.Col"
                                          MaxSizeX="@EditorState.Layout.TextPanel.MaxSizeX"
                                          MaxSizeY="@EditorState.Layout.TextPanel.MaxSizeY">
                        <HeaderTemplate><div>Text Content</div></HeaderTemplate>
                        <ContentTemplate>
                            <div class="p-1 w-100 h-100 overflow-auto">
                                <div class="border">
                                <h2>
                                    Stuff 2
                                </h2>
                                </div>
                            </div>
                        </ContentTemplate>
                    </DashboardLayoutPanel>
                    <DashboardLayoutPanel Id="@nameof(EditorState.Layout.AuxPanel)"
                                          SizeX="@EditorState.Layout.AuxPanel.SizeX"
                                          SizeY="@EditorState.Layout.AuxPanel.SizeY"
                                          MinSizeX="@EditorState.Layout.AuxPanel.MinSizeX"
                                          MinSizeY="@EditorState.Layout.AuxPanel.MinSizeY"
                                          Row="@EditorState.Layout.AuxPanel.Row"
                                          Col="@EditorState.Layout.AuxPanel.Col"
                                          MaxSizeX="@EditorState.Layout.AuxPanel.MaxSizeX"
                                          MaxSizeY="@EditorState.Layout.AuxPanel.MaxSizeY">
                        <HeaderTemplate><div>Attachments</div></HeaderTemplate>
                        <ContentTemplate>
                            <div class="p-1 w-100 h-100 overflow-auto">
                                <h2>
                                Stuff 3
                                </h2>
                            </div>
                        </ContentTemplate>
                    </DashboardLayoutPanel>
                </DashboardLayoutPanels>
            </SfDashboardLayout>


Is there a way to prevent this from happening? I have tried to use the Dashboard.Refresh() method, but that doesn't resolve the problem.


Here is a video of this happening : Disappearing Panels (at 00:15)




4 Replies 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team November 24, 2020 09:57 AM UTC

Hi Joseph Tan,  
 
Greetings from Syncfusion support. 
 
We have prepared a sample based on your shared video footage and we are unable to replicate the issue. Please, refer the sample link below. 
 
 
Based on your shared video, we identified that you have performed some operations on clicking on TreeView nodes. Could you please share the below details to identify the exact case of your reported problem. 
 
1.     What are the operations you have preformed when clicking the TreeView node items (share the code snippet)? 
2.     If you have bind the dragStop and resizeStop event of DashboardLayout component then share the code snippet for that events too. 
3.     Please, share the code snippet for how to update the component's parameters in your application. 
4.     If possible, replicate the issue in attached sample. 
 
And also, you have mentioned that similar issue occurs in Grid component. Could you please share the video footage of the grid component issue. 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 



JT Joseph Tan November 25, 2020 04:09 AM UTC

Hi There,

Grid issue - what I meant is the the GridLines in the layout disappears.


 <SfDashboardLayout @ref="@TheDashboardLayout" Columns="15" CellAspectRatio="2" CellSpacing="@(new double[]{10 ,10 })"
                               AllowDragging="true"  ShowGridLines="true"  AllowResizing="true" DraggableHandle=".e-panel-header">

GridLines can be seen:



GridLines disappear:




Regarding your questions: 
1.     What are the operations you have preformed when clicking the TreeView node items (share the code snippet)? 


A. The Treeview child will raise an event. 
B. The parent will update an object which is the parameter to the Dashboard Layout Child 
C. The Dashboard Layout Child will notice the parameter change.


Code for A: 

        protected void TreeItemSelected(NodeSelectEventArgs args)
        {
            if (args.NodeData.Id != null)
            {
                if (OnNodeSelected.HasDelegate)
                {
                    EventInProgress = true;
                    OnNodeSelected.InvokeAsync(args.NodeData.Id);
                    EventInProgress = false;
                }
            }
        }


Code for B:

        protected void NavClicked(string nodePath)
        {
            EditorState.SetCurrentItem(nodePath);
        }

Code for C: (it doesn't do much)


        protected override void OnParametersSet()
        {
            if (FirstRendered)
            {
                if (!EventInProgress)
                {
                    SpotBase.Logger.Information("OnParametersSet() : Called");
                    InvokeAsync(() => StateHasChanged());
                }
                else 
                {
                    SpotBase.Logger.Information("OnParametersSet() : Skipped (EventInProgress) ");
                }
            }
        }

Everytime a tree node is clicked you can see this logged:


2.     If you have bind the dragStop and resizeStop event of DashboardLayout component then share the code snippet for that events too. 


Here it is:

        protected void OnDragStopped(DragStopArgs args)
        {
            UpdateEditorLayout();
        }

        protected void OnResizeStopped(ResizeArgs args)
        {
            UpdateEditorLayout();
        }

        protected void UpdateEditorLayout()
        {
            if (TheDashboardLayout?.Panels != null)
            {
                foreach (var p in TheDashboardLayout.Panels)
                {
                    switch (p.Id)
                    {
                        case nameof(DisplayLayout.MediaPanel):
                            UpdateLayoutInfo(EditorState.Layout.MediaPanel, p);
                            break;
                        case nameof(DisplayLayout.AuxPanel):
                            UpdateLayoutInfo(EditorState.Layout.AuxPanel, p);
                            break;
                        case nameof(DisplayLayout.PracticePanel):
                            UpdateLayoutInfo(EditorState.Layout.PracticePanel, p);
                            break;
                        case nameof(DisplayLayout.TextPanel):
                            UpdateLayoutInfo(EditorState.Layout.TextPanel, p);
                            break;
                    }
                }

                if (LayoutChanged.HasDelegate)
                {
                    // this will cause OnParameterSet() to fire!
                    EventInProgress = true;
                    LayoutChanged.InvokeAsync(null);
                    EventInProgress = false;
                }
            }
        }



        private void UpdateLayoutInfo(PanelLayout toPanel, DashboardLayoutPanel fromPanel)
        {
            toPanel.Col = fromPanel.Col;
            toPanel.Row = fromPanel.Row;
            toPanel.SizeX = fromPanel.SizeX;
            toPanel.SizeY = fromPanel.SizeY;
            toPanel.MinSizeX = fromPanel.MinSizeX;
            toPanel.MinSizeY = fromPanel.MinSizeY;
            toPanel.MaxSizeX = fromPanel.MaxSizeX ?? fromPanel.SizeX;
            toPanel.MaxSizeY = fromPanel.MaxSizeY ?? fromPanel.SizeY;
        }

3.     Please, share the code snippet for how to update the component's parameters in your application. 

It is above (Code for B)

4.     If possible, replicate the issue in attached sample. 

I will try!

 


SP Sowmiya Padmanaban Syncfusion Team November 26, 2020 02:22 PM UTC

Hi Joseph Tan,  
 
We are able to replicate you reported problem with DashboardLayout component. Currently, we are validated your reported problem with DashboardLayout component. We will update the details within three business days on 1st December 2020. 
 
We appreciate your patience. 
 
Regards,  
Sowmiya.P 



SP Sowmiya Padmanaban Syncfusion Team November 30, 2020 12:36 PM UTC

Hi Joseph Tan,  
 
Thanks for your patience. 
 
We have validated your reported problem with DashboardLayout component.  We have consider this as a bug from our end. Fix for this issue will be included in our Volume 4 release which is expected to be rolled out by the end of December 2020. 
 
Please, track the following feedback link to know the status of this fix. 
 
 
We appreciate your patience. 
 
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon