Results 1 to 3 of 3

Thread: Can you change a closable tab to not be closable?

  1. #1
    Sencha User
    Join Date
    Aug 2009
    Location
    Austin, TX
    Posts
    100
    Vote Rating
    0
      0  

    Question Can you change a closable tab to not be closable?

    The question:
    Can a closable tab be dynamically made to be not closable?

    I did my best to search the forums directly as well as Google but couldn't find the answer.

    The background:
    I've got a tab panel to which tabs can be dynamically added by the user. I want these tabs to initially be closable so that if the user mistakenly added the tab they can correct this but the tab will contain a form and once they start answering questions on the form, I want to remove the ability to close the tab. I don't see a setClosable(boolean) method on TabPanel so I'm guessing the answer is no but want to make sure.

    Can this be done or do I just need to find a way to intercept the close event of the tab and prevent it if necessary? I'd rather just remove the little 'X' if possible and would prefer to use provided methods.

  2. #2
    Sencha User fay's Avatar
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    1,750
    Vote Rating
    10
      0  

    Default

    Code:
    Ext.fly(tabPanel.getTabEl(tabItem)).removeClass('x-tab-strip-closable');

  3. #3
    Sencha User
    Join Date
    Aug 2009
    Location
    Austin, TX
    Posts
    100
    Vote Rating
    0
      0  

    Default

    That worked. Thanks! I guess I need to figure out the benefits of the Ext.fly() method...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •