1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    4
    Vote Rating
    0
    up_s is on a distinguished road

      0  

    Default Unanswered: Subtitle in Panel

    Unanswered: Subtitle in Panel


    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

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,913
    Answers
    371
    Vote Rating
    179
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    Undoubtedly there's a more elegant way to do this, but here's something to mess about with:

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

    Code:
    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'
    });

Thread Participants: 1