Enhance findObject to handle panels in itemArray

In version 1.8.x, we were using findObject to find panels inside itemArray. We upgraded gojs to 2.x version and findObject is no more working.
Is there anything changed related to this between these versions?

Is there any api available to recurse through itemArray and give result?
If there is no direct api available, can you give us code snippet to do this?


As far as we know, Panel.findObject has not changed. It has never recursed into panels created by item templates. The reason is that if an object in an item template had a name, that name would be repeated in each copy of the template.

Could you please show us the simplest possible example that demonstrates the problem? What is your code?

Hey, Thanks for the reply.
Please find example here.

Comment/Uncomment script tag for switching between 1.8.x and 2.x version.
And in console you can see the difference.

Thanks for the code. We’ll investigate.

findObject was never meant to recurse into item array elements, and we made some implementation improvements to that method which caused this difference in behavior.

What is it that you are looking to do with the panels within the item array? You can probably accomplish what you want using the Panel.elements property.

const list = diagram.nodes.first().findObject('LIST');
const elts = list.elements;
elts.each(function(elt) {

Thanks. This helps