franco
franco

Reputation: 2047

add color in the fieldset in extjs 4.2

I want to make the title of my fieldset in red color

I try with this exampel without success :

{ xtype:'fieldset',
                columnWidth: 0.5,
                title: dataApplicant,
                collapsible: false,
                defaultType: 'textfield',
                defaults: {anchor: '100%'},
                layout: 'anchor',
                cls: 'my-fieldset',
                items :

                [
    .....
    ..

and I make in ext-all.css

.my-fieldset {
  background: #F1F3FB,
  border: 1px solid red
}
.my-fieldset .x-fieldset-header {
  color: red
}

also I want to have this text for example : name :(*)

I try with :

  {
                                xtype: 'textfield',
                                fieldLabel: 'name', 
                                allowBlank : false,
                                id: 'numeId',
                                flex: 1,
                                margin: '5 5 5 5'
                            },

and I didn't know how to add :(*)

after the textfield and I want that (*) should have the red color

I know how to do this in jsp but not in js

in jsp this is an example of code :

<tr>
                <td width="20%"><util:message
                            key="name.title" />:<font color="#FF0000">(*)</td>
                    <td width="80%" colspan="3"><form:textfield property="name" allowBlank="false"/></td>
                </tr>   

Upvotes: 0

Views: 2852

Answers (2)

fakelbst
fakelbst

Reputation: 628

You can simplely do like this:

fieldLabel: 'name' +  '<span style="color:red;">(*)</span>'

but this would like this name(*):
the colon symblo at the end.

Upvotes: 1

Carlos Valenzuela
Carlos Valenzuela

Reputation: 834

You can do this in several ways.

In the docs, you cand read that the title can contain HTML, so the title can be defined like this:

...
title: 'Title <span style="color: red">(*)</span>'
...

Upvotes: 0

Related Questions