1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    16
    Answers
    2
    Vote Rating
    0
    kelv1n is on a distinguished road

      0  

    Default Unanswered: Hide tab rather than close?

    Unanswered: Hide tab rather than close?


    Hi Guys

    When clicking the close button on a tab, the Tab appears to be destroyed - How can I hide and remove it from the Tab Panel, rather than destroying it? Then at a later time re-show it?

    Basically I'm using the Extjs 4 MVC, my app has a Tree for navigation on the Left and Tabs on the right, when a Tree item is selected, it opens a Tab, but when the User closes it, it seems pointless having to recreate each tab and reload the data next time, it seems wasteful there are possibly better approaches, so I'd be open for suggestions aswell.

    Thanks
    Kelvin

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    16
    Answers
    2
    Vote Rating
    0
    kelv1n is on a distinguished road

      0  

    Default


    I found 1 way around this, which was to add a listener to BeforeClose, but the interesting thing is calling Hide() on tab (p) did not work, instead I've had to call hide on both the tab and element.. Is there a more elegant way of doing this???

    Code:
    		    onClose: function(p) {
    		    	p.tab.hide();
    		     	p.getEl().hide();
    
    
    		     	return false; 
    		    }

  3. #3
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,592
    Answers
    541
    Vote Rating
    323
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Does it work if you remove it rather than hiding it, being careful not to destroy it?

    Though I understand where you're coming from, I wonder whether users will find it irritating that closing and reopening a tab doesn't reset it.

Thread Participants: 1