How can I find what tab a module is associated with in Dojo?

43 views Asked by At

I have a dijit TabContainer with multiple tabs open in it. On some of those tabs I create a new instance of a module. Is there a way to figure out which tab the module is associated with when it's created?

I thought I had this working using the TabContainer's selectedChildWidget, but I've found that I can start loading a tab and change tabs before it gets to the place in the script where it loads the module, which results in the module being associated with the wrong tab. If at all possible, I would like to keep this contained inside the module, and not rely on something outside the module to tell it which tab it's on.

1

There are 1 answers

1
srivelayutha raja On BEST ANSWER

We have implemented a similar scenario, the components inside the tabContainer should be selected only when the container is activated..

you can listen for '_transition' events in the Container and initialize the 'new' container from the event. and While initializing the module, you need to pass the new container reference, so that the new modules are placed at the relevant containers.