ExtJs Region面板隐藏时显示标题

Ext.ux.collapsedPanelTitlePlugin = function ()
{
this.init = function(p) {
if (p.collapsible)
{
var r = p.region;
if ((r == 'north') || (r == 'south'))
{
p.on ('render', function()
{
var ct = p.ownerCt;
ct.on ('afterlayout', function()
{
if (ct.layout[r].collapsedEl)
{
p.collapsedTitleEl = ct.layout[r].collapsedEl.createChild ({
tag: 'span',
cls: 'x-panel-collapsed-text',
html: p.title
});
p.setTitle = Ext.Panel.prototype.setTitle.createSequence (function(t)
{p.collapsedTitleEl.dom.innerHTML = t;});
}
}, false, {single:true});
p.on ('collapse', function()
{
if (ct.layout[r].collapsedEl && !p.collapsedTitleEl)
{
p.collapsedTitleEl = ct.layout[r].collapsedEl.createChild ({
tag: 'span',
cls: 'x-panel-collapsed-text',
html: p.title
});
p.setTitle = Ext.Panel.prototype.setTitle.createSequence (function(t)
{p.collapsedTitleEl.dom.innerHTML = t;});
}
}, false, {single:true});
});
}
}
};
}

 

.x-panel-collapsed-text{
color:#15428b;
font:bold 11px tahoma,arial,verdana,sans-serif;
border:0 none;
background-image:none;
}

 

region : 'south',
layout : 'border',
title:'临时任务',
collapsed:true,
plugins:new Ext.ux.collapsedPanelTitlePlugin(),
collapsible : true,
split : true

 

你可能感兴趣的:(html,ext,prototype)