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
Expected
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]