A basic tab container. TabPanels can be used exactly like a standard {@link Ext.Panel}
* for layout purposes, but also have special support for containing child Components
@@ -35,6 +41,9 @@
* the active tab.
*
{@link Ext.Panel#deactivate deactivate} : Fires when the Component that
* was the active tab becomes deactivated.
+ *
{@link Ext.Panel#beforeclose beforeclose} : Fires when the user clicks on the close tool of a closeable tab.
+ * May be vetoed by returning false from a handler.
+ *
{@link Ext.Panel#close close} : Fires a closeable tab has been closed by the user.
*
*
Creating TabPanels from Code
*
TabPanels can be created and rendered completely in code, as in this example:
@@ -104,11 +113,6 @@ Ext.TabPanel = Ext.extend(Ext.Panel, {
* class name applied to the tab strip item representing the child Component, allowing special
* styling to be applied.
*/
- /**
- * @cfg {Boolean} monitorResize True to automatically monitor window resize events and rerender the layout on
- * browser resize (defaults to true).
- */
- monitorResize : true,
/**
* @cfg {Boolean} deferredRender
*
true by default to defer the rendering of child {@link Ext.Container#items items}
@@ -440,8 +444,9 @@ new Ext.TabPanel({
// private
findTargets : function(e){
- var item = null;
- var itemEl = e.getTarget('li', this.strip);
+ var item = null,
+ itemEl = e.getTarget('li:not(.x-tab-edge)', this.strip);
+
if(itemEl){
item = this.getComponent(itemEl.id.split(this.idDelimiter)[1]);
if(item.disabled){
@@ -549,8 +554,8 @@ new Ext.TabPanel({
beforeshow: this.onBeforeShowItem
});
},
-
-
+
+
/**
*
Provides template arguments for rendering a tab selector item in the tab strip.
@@ -562,7 +567,7 @@ new Ext.TabPanel({
*
cls : String
The CSS class name
*
iconCls : String
A CSS class to provide appearance for an icon.
*
- * @param {BoxComponent} item The {@link Ext.BoxComponent BoxComponent} for which to create a selector element in the tab strip.
+ * @param {Ext.BoxComponent} item The {@link Ext.BoxComponent BoxComponent} for which to create a selector element in the tab strip.
* @return {Object} An object hash containing the properties required to render the selector element.
*/
getTemplateArgs : function(item) {
@@ -591,9 +596,6 @@ new Ext.TabPanel({
if(this.rendered){
var items = this.items;
this.initTab(c, items.indexOf(c));
- if(items.getCount() == 1){
- this.syncSize();
- }
this.delegateUpdates();
}
},
@@ -770,7 +772,7 @@ new Ext.TabPanel({
var each = Math.max(Math.min(Math.floor((aw-4) / count) - this.tabMargin, this.tabWidth), this.minTabWidth); // -4 for float errors in IE
this.lastTabWidth = each;
- var lis = this.strip.query("li:not([className^=x-tab-edge])");
+ var lis = this.strip.query('li:not(.x-tab-edge)');
for(var i = 0, len = lis.length; i < len; i++) {
var li = lis[i],
inner = Ext.fly(li).child('.x-tab-strip-inner', true),
@@ -820,10 +822,10 @@ new Ext.TabPanel({
Ext.fly(oldEl).removeClass('x-tab-strip-active');
}
}
+ this.activeTab = item;
if(item){
var el = this.getTabEl(item);
Ext.fly(el).addClass('x-tab-strip-active');
- this.activeTab = item;
this.stack.add(item);
this.layout.setActiveItem(item);
@@ -976,11 +978,11 @@ new Ext.TabPanel({
*/
scrollToTab : function(item, animate){
- if(!item){
- return;
+ if(!item){
+ return;
}
var el = this.getTabEl(item),
- pos = this.getScrollPos(),
+ pos = this.getScrollPos(),
area = this.getScrollArea(),
left = Ext.fly(el).getOffsetsTo(this.stripWrap)[0] + pos,
right = left + el.offsetWidth;
@@ -1132,6 +1134,6 @@ Ext.TabPanel.AccessStack = function(){
}
};
};
-
-
+
+
\ No newline at end of file