LearnNewsExamplesServices
Frontmatter
id3697
titleNeo.findCmp()
stateClosed
labels
enhancement
assignees[]
createdAtDec 28, 2022, 1:35 PM
updatedAtJan 2, 2023, 8:43 PM
githubUrlhttps://github.com/neomjs/neo/issues/3697
authorDinkh
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 2, 2023, 8:43 PM

Neo.findCmp()

Closed v8.1.0 enhancement
Dinkh
Dinkh commented on Dec 28, 2022, 1:35 PM

The developer wants to be able to find all component with certain stats.

@returns []

@examples Neo.findCmp('button'); => string finds items with ntype Neo.findCmp({ntype: button, text: 'foo'}) => object results in item that match all key|values

This should be kind of a shortcut for Neo.manager.Component.find(). We to be able to hand over a ntype as string.

Dinkh added the enhancement label on Dec 28, 2022, 1:35 PM
Dinkh
Dinkh Jan 2, 2023, 8:43 PM

Done in 4.4.15

use

// second param is returnFirstMatch
// to find all items use
Neo.first('button', false);

Since 4.4.15 ntype will go through all prototypes and therefore find all buttons even if you added your own ntype.

Dinkh closed this issue on Jan 2, 2023, 8:43 PM