Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/docs/source/TabPanel.html view on Meta::CPAN
var beforeEl = (this.tabPosition=='bottom' ? this.stripWrap : null);
st.createChild({cls:'x-tab-strip-spacer'}, beforeEl);
this.strip = new Ext.Element(this.stripWrap.dom.firstChild);
// create an empty span with class x-tab-strip-text to force the height of the header element when there's no tabs.
this.edge = this.strip.createChild({tag:'li', cls:'x-tab-edge', cn: [{tag: 'span', cls: 'x-tab-strip-text', cn: ' '}]});
this.strip.createChild({cls:'x-clear'});
this.body.addClass('x-tab-panel-body-'+this.tabPosition);
<span id='Ext-TabPanel-cfg-itemTpl'> /**
</span> * @cfg {Template/XTemplate} itemTpl <p>(Optional) A {@link Ext.Template Template} or
* {@link Ext.XTemplate XTemplate} which may be provided to process the data object returned from
* <tt>{@link #getTemplateArgs}</tt> to produce a clickable selector element in the tab strip.</p>
* <p>The main element created should be a <tt>&lt;li></tt> element. In order for a click event on
* a selector element to be connected to its item, it must take its <i>id</i> from the TabPanel's
* native <tt>{@link #getTemplateArgs}</tt>.</p>
* <p>The child element which contains the title text must be marked by the CSS class
* <tt>x-tab-strip-inner</tt>.</p>
* <p>To enable closability, the created element should contain an element marked by the CSS class
* <tt>x-tab-strip-close</tt>.</p>
* <p>If a custom <tt>itemTpl</tt> is supplied, it is the developer's responsibility to create CSS
* style rules to create the desired appearance.</p>
* Below is an example of how to create customized tab selector items:<pre><code>
new Ext.TabPanel({
renderTo: document.body,
minTabWidth: 115,
tabWidth: 135,
enableTabScroll: true,
width: 600,
height: 250,
defaults: {autoScroll:true},
itemTpl: new Ext.XTemplate(
'&lt;li class="{cls}" id="{id}" style="overflow:hidden">',
'&lt;tpl if="closable">',
'&lt;a class="x-tab-strip-close">&lt;/a>',
'&lt;/tpl>',
'&lt;a class="x-tab-right" href="#" style="padding-left:6px">',
'&lt;em class="x-tab-left">',
'&lt;span class="x-tab-strip-inner">',
'&lt;img src="{src}" style="float:left;margin:3px 3px 0 0">',
'&lt;span style="margin-left:20px" class="x-tab-strip-text {iconCls}">{text} {extra}&lt;/span>',
'&lt;/span>',
'&lt;/em>',
'&lt;/a>',
'&lt;/li>'
),
getTemplateArgs: function(item) {
// Call the native method to collect the base data. Like the ID!
var result = Ext.TabPanel.prototype.getTemplateArgs.call(this, item);
// Add stuff used in our template
return Ext.apply(result, {
closable: item.closable,
src: item.iconSrc,
extra: item.extraText || ''
});
},
items: [{
title: 'New Tab 1',
iconSrc: '../shared/icons/fam/grid.png',
html: 'Tab Body 1',
closable: true
}, {
title: 'New Tab 2',
iconSrc: '../shared/icons/fam/grid.png',
html: 'Tab Body 2',
extraText: 'Extra stuff in the tab button'
}]
});
</code></pre>
*/
if(!this.itemTpl){
var tt = new Ext.Template(
'<li class="{cls}" id="{id}"><a class="x-tab-strip-close"></a>',
'<a class="x-tab-right" href="#"><em class="x-tab-left">',
'<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',
'</em></a></li>'
);
tt.disableFormats = true;
tt.compile();
Ext.TabPanel.prototype.itemTpl = tt;
}
this.items.each(this.initTab, this);
},
<span id='Ext-TabPanel-method-afterRender'> // private
</span> afterRender : function(){
Ext.TabPanel.superclass.afterRender.call(this);
if(this.autoTabs){
this.readTabs(false);
}
if(this.activeTab !== undefined){
var item = Ext.isObject(this.activeTab) ? this.activeTab : this.items.get(this.activeTab);
delete this.activeTab;
this.setActiveTab(item);
}
},
<span id='Ext-TabPanel-method-initEvents'> // private
</span> initEvents : function(){
Ext.TabPanel.superclass.initEvents.call(this);
this.mon(this.strip, {
scope: this,
mousedown: this.onStripMouseDown,
contextmenu: this.onStripContextMenu
});
if(this.enableTabScroll){
this.mon(this.strip, 'mousewheel', this.onWheel, this);
}
},
<span id='Ext-TabPanel-method-findTargets'> // private
</span> findTargets : function(e){
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){
return {
close : null,
item : null,
el : null
};
( run in 0.455 second using v1.01-cache-2.11-cpan-df04353d9ac )