FF Style Tab closing & switching - Ext JS

Hey, just throwing it out there... is it possible to remember the last tab you were on when closing a tab instead of defaulting to the next tab in line? This is the default behavoir in FF2 which makes navigating more intuitive since when you close a tab it always jumps back to the last tab you were on. I realize that this only happens in FF2 for tabs that are loaded by actions within another tab (creating a sort of soft parent/child relationship) but it would be great if that same sort of functionality were possible in Ext.

Just in case that wasn't clear here is a case scenario:

[tab1-users] [tab2-options] [...dynamically created tabs]....

On the users tab I have a list of users each with a link that creates a new tab. The new tab contains all the specific user data. After closing the new tab my next active tab is the options tab. It would be nice if it could revert back to the users tab.
  # 2  
03-02-2007, 04:27 PM

Another thing that I have noticed is that a tab will lose its scroll position when you switch to another tab and then switch back. For example if you are viewing a grid in a grid panel tab and scroll half way down the list, switch to another tab and then switch back the scroll position of that grid is now at the top again.

Is it at all possible to retain this scroll position so the tab switching behaves as typical tab switching does (ie. the content is unmodified on tab switch)?
  # 3  
03-03-2007, 04:12 PM

If you use the default method of scrolling (the tab body wrap) it will lose its scroll position because all child panels share the same overflow container. However, you are welcome to set overflow auto on each panel directly (via css?) and have them each have their own scroll overflow.

As for remembering the last tab, it would be much easier for you to implement than for me to do in a generic and configurable way. Using the state manager and tabchange event, you could probably do it in 5-10 lines of code.
  # 4  
03-06-2007, 01:29 PM

Awesome, thank you very much.
  # 5  
03-06-2007, 08:22 PM

By the way, I forgot to mention, there is a function to override on TabPanel specifically designed for customizing how the closing order goes (getNextAvailable).
  # 6  
03-07-2007, 12:52 PM

Excellent!

你可能感兴趣的:(css,ext,IE)