Reopen closed tabs on ExtJS TabPanel and autoDestroy

by 5. January 2010 00:58

Basically when you close a tab TabPanel completely destroys it by default (and you can’t reopen closed tab).

To override this behavior add autoDestroy: false to your TabPanel settings object.

But when you try to close a tab you will see  something like this:

autoDestroy_before

That is, tab header is disappeared but the body still visible.

The problem is that you should process remove operation by yourself. Especially if you still want to hide tab body after closing the tab. To do this add two event handlers:

listeners: { 
            remove: function(tp, c) { 
                c.hide(); 
            }, 
            add: function(tp, c) { 
                c.show(); 
            } 
        }

autoDestroy_after

Tags:

IT | Software

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name: Ilya Khaprov (rus Илья Хапров)

Age: 23

Sex: Male

I'm a postgraduate (an "aspirant" in Russian terminology see Wikipedia for details) at Bryansk State Technical University.

I'm working with .Net since 2004. Also i like lisp.

My research interests lie in the area of Intelligence. In particular i am studing personal information filters, ontology learning, and some other stuff.

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

© Copyright 2009

Recent Visitors