Author Topic: How to find a specified folder from a collection in jArchi  (Read 72 times)

Manj75

  • Senior Member
  • ****
  • Posts: 152
How to find a specified folder from a collection in jArchi
« 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:
Code: [Select]
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:
Code: [Select]
> Open Projects Folder: [folder: Open Projects]
> projectFolders: []

Jean-Baptiste Sarrodie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 695
  • Archi Evangelist and Contributor. Visionary.
    • About me...
Re: How to find a specified folder from a collection in jArchi
« Reply #1 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
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate