ExtJs Region 패널 숨기기 시 제목 표시

1662 단어 htmlextprototype
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

좋은 웹페이지 즐겨찾기