e.forEach is Not a Function on Dashboard Render

Description

The error "TypeError: e.forEach is not a function" is output to the console when a DashboardLayout is initialized with a  List of objects that contains no objects (not NULL, but List.Count == 0) and then an object is added to the List from the parent. When the object is added to the list, the Panel spans the entire screen, and each new object that is added is displayed on top of the previous one. The panels are also not movable or resizeable, even though both are set to TRUE.

However, when navigating to a different page, then re-initializing the Dashboard when the list already contains objects, the Dashboard renders without any issues, or any errors in the console.

Any help or insight would be greatly appreciated!
I've also attached an example project that shows both methods (1. Rendering the Dashboard, then adding a new object and 2. Adding objects before rending Dashboard)
Please let me know if any additional information is needed.

The full context of my environment is below:

Component Markup

@if (TestObjects != null)
{
     <EjsDashboardLayout @ref="Dashboard" CellSpacing="CellSpacing" Columns="Columns"
                                 AllowDragging="AllowDragging" AllowResizing="AllowResizing" MediaQuery="max-width:700px;">
                 <DashboardLayoutPanels>
                     @foreach (var ob in TestObjects)
                     {
                         <DashboardLayoutPanel SizeX="SizeX" SizeY="SizeY" ZIndex="0">
                             <ContentTemplate>
                                 <ChildComponent ItemValue="ob" />
                             </ContentTemplate>
                         </DashboardLayoutPanel>
                     }
                 </DashboardLayoutPanels>
     </EjsDashboardLayout>
}

Component Code

    [Parameter]
    public List<TestObject> TestObjects { get; set; }

    [Parameter]
    public Double[] CellSpacing { get; set; } = new double[] { 20, 20 };

    [Parameter]
    public int Columns { get; set; } = 5;

    [Parameter]
    public int SizeX { get; set; } = 1;

    [Parameter]
    public int SizeY { get; set; } = 1;

    [Parameter]
    public Boolean AllowDragging { get; set; } = true;

    [Parameter]
    public Boolean AllowResizing { get; set; } = true;

    private EjsDashboardLayout Dashboard { get; set; }

Error in Console

ejs.interop.min.js:1 e.forEach is not a function

TypeError: e.forEach is not a function
    at t.checkForIDValues (https://cdn.syncfusion.com/ej2/17.4.49/dist/ej2.min.js:10:6001536)
    at t.onPropertyChanged (https://cdn.syncfusion.com/ej2/17.4.49/dist/ej2.min.js:10:6001721)
    at t.e.dataBind (https://cdn.syncfusion.com/ej2/17.4.49/dist/ej2.min.js:10:504404)
    at t.dataBind (https://cdn.syncfusion.com/ej2/17.4.49/dist/ej2.min.js:10:520832)
    at t.e.setProperties (https://cdn.syncfusion.com/ej2/17.4.49/dist/ej2.min.js:10:503622)
    at Object.setModel (https://cdn.syncfusion.com/ej2/17.4.49/dist/ejs.interop.min.js:1:5122)
    at https://localhost:44340/_framework/blazor.webassembly.js:1:9610
    at new Promise (<anonymous>)
    at Object.beginInvokeJSFromDotNet (https://localhost:44340/_framework/blazor.webassembly.js:1:9579)
    at _mono_wasm_invoke_js_marshalled (https://localhost:44340/_framework/wasm/dotnet.js:1:166149)

Screenshots

Issue

Empty


Expected

Empty



Output of dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   3.1.200-preview-014883
 Commit:    4e2a0ee959

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17134
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.1.200-preview-014883\

Host (useful for support):
  Version: 3.1.1
  Commit:  a1388f194c

.NET Core SDKs installed:
  2.1.509 [C:\Program Files\dotnet\sdk]
  3.0.100 [C:\Program Files\dotnet\sdk]
  3.1.100-preview2-014569 [C:\Program Files\dotnet\sdk]
  3.1.100-preview3-014645 [C:\Program Files\dotnet\sdk]
  3.1.101 [C:\Program Files\dotnet\sdk]
  3.1.200-preview-014883 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.0-preview3.19555.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.0-preview1.19506.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.0-preview3.19553.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.0-preview3.19553.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]



Attachment: Syncfusion_Dashboard_Issue_fa6c1a73.zip

3 Replies

SP Sowmiya Padmanaban Syncfusion Team February 13, 2020 08:46 AM UTC

Hi Christopher,  
 
Greetings from Syncfusion support. 
 
We have checked your attached code snippet and identified that you have to added the panel element to the DashboardLayout directly. 
 
In DashboardLayout component, we have added all the calculations for panel position and properties (floating , resizing, dragging) in component script. we suggest you to use the method AddPanel() for properly adding the panel in the Dashboard Layout. On using this method for adding panels, the panels will get added properly with expected behavior. 
 
We have prepared a simple sample for adding the panel in DashboardLayout using AddPanel() method. Refer the sample link below. 
 
 
We have some issue while adding multiple panels during single button click. We have already fixed this issue from our side and now it is in testing phase. We will include the fix for this issue in our February third weekly release which is expected to be released at the end of the third week of February. 
 
Track the below link for bug status. 
 
 
 
 
Please let us know, if you need any further assistance. 
 
Regards, 
Sowmiya.P 



CS Christopher Swierczynski replied to Sowmiya Padmanaban February 14, 2020 07:26 PM UTC

Hi Christopher,  
 
Greetings from Syncfusion support. 
 
We have checked your attached code snippet and identified that you have to added the panel element to the DashboardLayout directly. 
 
In DashboardLayout component, we have added all the calculations for panel position and properties (floating , resizing, dragging) in component script. we suggest you to use the method AddPanel() for properly adding the panel in the Dashboard Layout. On using this method for adding panels, the panels will get added properly with expected behavior. 
 
We have prepared a simple sample for adding the panel in DashboardLayout using AddPanel() method. Refer the sample link below. 
 
 
We have some issue while adding multiple panels during single button click. We have already fixed this issue from our side and now it is in testing phase. We will include the fix for this issue in our February third weekly release which is expected to be released at the end of the third week of February. 
 
Track the below link for bug status. 
 
 
 
 
Please let us know, if you need any further assistance. 
 
Regards, 
Sowmiya.P 


Hi Sowmiya,

Thank you for the quick response and the sample.
I was able to create a working-model using the logic in the sample.

I appreciate it!


SP Sowmiya Padmanaban Syncfusion Team February 17, 2020 04:42 AM UTC

Hi Christopher,  
  
Most welcome. We are glad to hear that the provided solution resolved your issue. Please let us know, if you need any further assistance. 
  
Regards,  
Sowmiya.P 


Loader.
Up arrow icon