Archi Forum

Archi Plug-ins => jArchi => Topic started by: Manj75 on June 15, 2021, 14:44:43 PM

Title: How to find a specified folder from a collection in jArchi
Post by: Manj75 on June 15, 2021, 14:44:43 PM
I've been struggling to successfully use the collection.find(selector) and instead been having to resort to an iteration of the collection.

I have the following folder structure:

Views
+-Open Projects
    +--Project1
    +--Project2
    +--Project3

I use the following code to find Project2:
var openProjectsFolderObject = $("folder." + "Open Projects");
console.log("> Open Projects Folder: " + openProjectsFolderObject);

var projectFolder = openProjectsFolderObject.find($("folder." + "Project2"));
console.log("> projectFolders: " + projectFolders);


Output I get is:
> Open Projects Folder: [folder: Open Projects]
> projectFolders: []
Title: Re: How to find a specified folder from a collection in jArchi
Post by: Jean-Baptiste Sarrodie on June 15, 2021, 15:44:20 PM
Hi,

If you want to find an object based on its "path", then here is an example: https://forum.archimatetool.com/index.php?topic=976.msg5311#msg5311

Regards,

JB