Send to back command not working when there is mutiple layers

hello

I added 3  layers on the diagram then I tried to use this codes

Note : I'm using 20.4.42 version

let layer = this.diagram?.getActiveLayer();
if (layer && layer.objects && layer.objects.length) {

let nodes = this.diagram?.nodes.filter((a: NodeModel) => layer?.objects?.includes(a.id || ''));
if (nodes && nodes.length) {
this.diagram?.clearSelection();
if (nodes.length == 1)
this.diagram?.select(nodes, false, undefined);
else
this.diagram?.select(nodes), true, undefined);
this.diagram?.sendToBack();
}


}

when there is multiple object every thing is ok but when there is only one object in the layer error will raise

core.mjs:7629 ERROR TypeError: Cannot read properties of undefined (reading 'parentId')

error-1.PNG

in the picture the line 38050 zIndexTable size is 1 and i_4 equals to 1 so its obvious target variable will be undefined, im using

"@syncfusion/ej2-angular-diagrams": "^20.4.42",

4 Replies

GD Gobinath Dhamotharan Syncfusion Team February 17, 2023 12:00 PM UTC

Hi Liam,


The issue is reflected at our end. We will validate and update you with more details on Feb 21, 2023.


Regards,

Gobinath



GD Gobinath Dhamotharan Syncfusion Team February 21, 2023 03:01 PM UTC

Hi Liam,  

Reported Issue : Send to back command not working when there is single node in layer

We can reproduce the issue and confirmed this as a defect. We have logged a defect report for this issue. We will fix this issue and provide the patch on March 07th, 2023 weekly patch release.  

https://www.syncfusion.com/feedback/41398/send-to-back-command-not-working-when-there-is-single-node-in-layer


Note: The sendToBack method works when there are multiple nodes in the diagramAlso, the order commands works within the layer. For single node in layer it won’t works, However, we will fix the exception reported in this forum.


Regards,  

Gobinath



BM Balasubramanian Manikandan Syncfusion Team March 8, 2023 01:54 PM UTC

We have fixed the issue and provided custom package below. However, we will include the fix for the issue in our upcoming weekly release which is scheduled to release on March 14th, 2023.


Attachment: package_bd8045b5.zip


GD Gobinath Dhamotharan Syncfusion Team March 15, 2023 06:00 AM UTC

Hi Liam,

 We have fixed the reported issue and included it in our latest patch release which is rolled out successfully. Please upgrade to the latest version (v20.4.54) packages of the diagram to resolve this issue.      

https://www.npmjs.com/package/@syncfusion/ej2-diagrams

 Regards,

Gobinath


Loader.
Up arrow icon