PDA

View Full Version : [CLOSED] MVC 3 [Razor] Tabpanel Click



dheeraj_us
Sep 14, 2012, 7:06 PM
Couple of questions:

1. How do I get the Click event of the Tab, call a Javascript function and pass the ID of the clicked Tab to that function?
2. How to do Ext.getCmp('tabPanel1').getActiveTab().getId(); [Throws error "object is null or undefined"]

Thanks

Daniil
Sep 15, 2012, 6:42 PM
Hi,


1. How do I get the Click event of the Tab, call a Javascript function and pass the ID of the clicked Tab to that function

I would suggest to use the Activate event.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tab.Tab-event-activate

Or, maybe, the TabChange event of TabPanel.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tab.Panel-event-tabchange

Please clarify will it suite your needs?


2. How to do Ext.getCmp('tabPanel1').getActiveTab().getId(); [Throws error "object is null or undefined"]

I tested your code, it works well for me.

Which moment do you call this code? Could you provide a sample?

dheeraj_us
Sep 18, 2012, 7:21 PM
I got the fix, this thread can be closed.