suamikim
suamikim

Reputation: 5319

Ext 4.1.1: Label inside a surrounding div

Hy there,

how can i create an Ext.form.Label that is always surrounded by a div without losing all the functionality of the label (setText, ...)? I've already played a little with autoEl, rendertTpl and manually creating the div and moving the label into it in afterrender but nothing really worked out too well.

I'd really appreciate some help on this!

Thanks

Upvotes: 1

Views: 79

Answers (1)

Vlad
Vlad

Reputation: 3645

You can just use a div in label text hiding a labelSeparator:

    {
        xtype: 'textarea',
        anchor: '100%',
        rows: 8,
        padding: '5 5 20 5',
        fieldLabel: '<div style="border: #999 solid 1px; padding: 5px;">Label text:</div>',
        labelSeparator: ''
    }

Result screenshot

Or use html property of Ext.form.Label.

Upvotes: 3

Related Questions