tree
authorJason Etheridge <jason@EquinoxOLI.org>
Mon, 1 May 2023 09:46:31 +0000 (05:46 -0400)
committerJason Etheridge <phasefx@gmail.com>
Thu, 25 May 2023 16:45:32 +0000 (12:45 -0400)
Open-ILS/src/eg2/src/app/share/tree/tree.ts

index 6d72d30..047e92f 100644 (file)
@@ -91,6 +91,17 @@ export class Tree {
         }
     }
 
+    findNodesByFieldAndValue(field: string, value: any): TreeNode[] {
+        const list = this.nodeList();
+        let found = [];
+        for (let idx = 0; idx < list.length; idx++) {
+            if (list[idx][field] === value) {
+                found.push( list[idx] );
+            }
+        }
+        return found;
+    }
+
     findParentNode(node: TreeNode) {
         const list = this.nodeList();
         for (let idx = 0; idx < list.length; idx++) {