Hello everyone.
I got ViewStack with 3 components inside.
How to change ViewStack active index from inside of one of
this components ?
|||
Hi Seth,
If I were you, I would pass a reference to ViewStack to the
components which it holds and then just call the required
methods/properties on this reference.
Cheers,
Dmitri.|||
or you could call the viewstack through the hierarchy of your
app…
this.parentApplication.myComp.myViewStack.selectedIndex =
newIndex;|||
Hello,
Also, you could try using a ModelLocator like the one
implemented in the Cairngorm framework. then you can just refrence
your viewstack from anywhere.
If you haven’t tried an MVC system it’s something worth
looking at if your app will be of any size.
3 solutions, all should work though if you just want
somethign quick and dirty I’d reccommend passing the refrence as
mentioned in the first reply
Cheers|||
First solution I already use in my app but as BrendSmith says
it’s a bit dirty.
I don’t want to use another library such as Caringorm so I
think second option – navigating thru hierarchy tree – should do
the job.
Thanks for reply
Related posts:
- Change viewstack that is within a component
- viewStack + load component function
- viewStack problem
- Please help with ViewStack(Newbie here)
- Issue with videos in a ViewStack
Related posts brought to you by Yet Another Related Posts Plugin.