Frontmatter
| id | 4781 |
| title | container.Base: getItem() |
| state | Closed |
| labels | enhancement |
| assignees | tobiu |
| createdAt | Aug 25, 2023, 4:28 PM |
| updatedAt | Apr 7, 2024, 5:16 PM |
| githubUrl | https://github.com/neomjs/neo/issues/4781 |
| author | ThorstenRaab |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Apr 7, 2024, 5:16 PM |
/** * @param {String} reference * @returns {Object|Neo.component.Base|null} */ getItem(reference, items = this.items) { let i = 0, len = items.length, item, childItem; for (; i < len; i++) { item = items[i]; if (item.reference === reference) { return item } else if (item.items) { childItem = this.getItem(reference, item.items); if (childItem) { return childItem; } } } return null }`something like this would help to address components better