Issue #2346Opened October 21, 2019by frankpagan1 reactions

When a component is clicked is there a hook to know when the traits have rendered.

Question

Hey Grapes Community, When a component is clicked from within canvas is there a hook or event to know when the traits have rendered in view container for the selected component?

Answers (2)

frankpaganOctober 24, 20191 reactions

Perfect, Thank you!

pouyamiralayiOctober 21, 20190 reactions

Hi there!

When a component is clicked

component:selected is the event you are looking for. more on this here

to know when the traits have rendered in view container

based on the nature of the the suggested event, you will receive the model of the selected component as an argument, this way you can check for the availability of any trait on the model:

editor.on('component:selected', ( model => {
        console.log(model.get('traits'))
    })
)

cheers!

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.