PDA

View Full Version : Subtitle in Panel



up_s
2 Jan 2013, 2:09 PM
Hi

Is there a way I can have a subtitle along with the title in a Panel? I don't think subtitle is part of framework.

Thanks

slemmon
2 Jan 2013, 2:44 PM
Undoubtedly there's a more elegant way to do this, but here's something to mess about with:

http://jsfiddle.net/slemmon/ncvhc/



?Ext.define('myPanel', { extend: 'Ext.panel.Panel'
, alias: 'widget.mypanel'

, initComponent: function () {
var me = this;


if (me.subTitle) {
me.title = me.title + '<br><i style="font-size:.8em;color:#C47A02;">' + me.subTitle + '</i>';
}

me.callParent(arguments);
}
});


Ext.widget('mypanel', {
renderTo: Ext.getBody()
, width: 200
, height: 200
, collapsible: true
, title: 'Title'
, subTitle: 'sub-title'
});