View Full Version : Can different tabs have single(common) controller?

15 Nov 2012, 1:07 AM
Can different tabs of a tab panel have a single(common) controller?
Actually i am generating new tabs in my tab panel on click of a button , these tabs need to be mapped to a controller . All these new tabs have common functionality so can i use same controller or generate new controllers dynamically for each tab at the time when new tabs are getting generated?

15 Nov 2012, 2:35 AM
The answer is yes provided that you can refer to these tabs by using the same selector.

15 Nov 2012, 5:56 AM
Yes, the trick is to use itemId's (itemId's are relative to the component) and when you provide an action you then getCurrentTab() to grab a reference to which tab you are in.

20 Nov 2012, 6:51 AM
thanks vietits/dawesi.
I didnt get either of ur answer's can u be more specific / explain in detail as i am new to ExtJS:)