How to stop tabChange event of a tabstrip after changing its activeTabIndex in Javascript ??

  1. #1

    How to stop tabChange event of a tabstrip after changing its activeTabIndex in Javascript ??

    I'm able to change ActiveTabIndex of Tabstrip but the problem is tabChange event is firing again. How to stop the this event ??
    Hi,
    Below is the code for changing tha activetabindex of tabstrip. It s working fine.

    function test(){
    var tabstrip = Ext.getCmp('tsParentModules')
                tabstrip.setActiveTab(-1);
    }
    But the problem now is, because of changing the Activetabindex of the tab, its tabChange event is firing again and loading the respective page.
    After changing the activetabindex property of the tab, I want to stop firing tabChange event. How can i do that?
    I tried with below line but no result.

    1 Ext.EventObject.stopEvent();

    Plzz provide me a solution asap.
    Thanks in advance,

    Santhosh
  2. #2
    Hi,

    Please try:
    tabstrip.suspendEvents();
    tabstrip.setActiveTab(-1);
    tabstrip.resumeEvents();
  3. #3

    Worked Fine. But if i click again on the same tab, it is not working.

    Thanks Daniil,
    After adding your lines, it is stopped firing tabChange event itself. That is fine.
    But now i click on that tab manually it is not opening respective page. (If i move my mouse cursor on it, it is showing HAND symbol).
    What is need to add more to work this?
    Plz help me!!

    Thanks,
    Santhosh

    Quote Originally Posted by Daniil View Post
    Hi,

    Please try:
    tabstrip.suspendEvents();
    tabstrip.setActiveTab(-1);
    tabstrip.resumeEvents();
    Last edited by santhu12smart; Oct 13, 2011 at 11:18 AM.
  4. #4
    Well, what is the reason to use "-1" in .setActiveTab()?
  5. #5
    Hi Daniil, My intention is to make all the tabs in the tabstrip to inActive. Then user can select any tab.
    Thats'y i given ActiveTabIndex to -1. Is it correct way or is there any other way to make tab to inactive?




    Quote Originally Posted by Daniil View Post
    Well, what is the reason to use "-1" in .setActiveTab()?
    Last edited by santhu12smart; Oct 13, 2011 at 11:40 AM.
  6. #6
    Please try:
    var el = TabStrip1.getTabEl(TabStrip1.activeTab);
                
    if (el) {
        Ext.fly(el).removeClass("x-tab-strip-active");
    }
    
    TabStrip1.activeTab = null;
  7. #7

    Wow... Worked well..!!

    Brilliant, Worked like a charm.
    Really Thanks alot Daniil..!!

    Regards,
    Santhosh

Similar Threads

  1. Replies: 14
    Last Post: Dec 27, 2012, 4:18 PM
  2. TabStrip and DirectEvents with TabChange
    By HansWapenaar in forum 2.x Help
    Replies: 0
    Last Post: May 23, 2012, 1:21 PM
  3. [CLOSED] Tabstrip tab items and dynamically changing titles
    By UGRev in forum 1.x Legacy Premium Help
    Replies: 14
    Last Post: Oct 13, 2011, 9:31 AM
  4. Replies: 2
    Last Post: Aug 08, 2011, 6:26 PM
  5. Replies: 3
    Last Post: Oct 17, 2010, 1:22 PM

Posting Permissions