1
votes

Inside a tabpanel,there is a tab,in the tab there is a gridpanel. One of the columns in the grid needs to have a renderer. The renderer needs to use a property that is defined at the scope level of tabpanel. So from inside column model, can we access the outer scope of tabpanel?

Thanks.

1
Why don't you place that property in a globaly accessible object where it's much easier to find?Erich Kitzmueller
What will be the scope of the globally accessible object?Victor

1 Answers

1
votes

There are a couple of ways of doing this, however not all are very good to use!

  1. use Ext.getCmp(), but I STRONGLY advise you not to do so
  2. use myComponent.ownerCt to travel up in the hyrarchy of components (from child to parent)
  3. on construction of the child component (where 'this' is the parent's scope) create a delegate handler in the child to update things in the parent
  4. use events to trigger actions, I usually create a singleton eventhandler in my application that allows components to communicate through the Publish-Subscribe pattern

Good luck