Forum Discussion

nmaves's avatar
nmaves
Visitor
8 years ago

Showing a dialog from deep down the component tree.

All of the examples of dialogs are a bit simple.  

When you are deep down the component tree how do you display a dialog?  m.top is not my "scene" component and there for nothing happens when I set m.top.dialog.  

How do I get access to that top level scene node?

2 Replies

  • I believe the way to do this is to have a field on the child node that's observed by the parent node.  The parent can then see that field changed and set its own field observed by its own parent to pass it on up to the top, where it would be observed and displayed.
  • So I found this little bit of code and it worked!

    m.top.getScene().dialog = dialog


    Though it is only supported in 7.6 and up.  I am not sure how many devices run < 7.5