在extjs4.1中更改xtype文本的颜色

Mic*_*eal 0 javascript extjs extjs4.1 xtype

我需要更改下面文字的颜色.除了文本颜色之外,样式字段中的其他所有内容都有效.谁能告诉我这里做错了什么?

{
                            xtype: 'text',

                            text: "Logged in as:",
                            textAlign:'left',
                            style : "color:#3E546B;font-style:italic;font-family: tahoma, arial, verdana, sans-serif;font-size: 11px;",
                            width: 140,
                            handler: function() {
                                document.location.href="";
                            }
                        },
Run Code Online (Sandbox Code Playgroud)

编辑.我没有使用表单面板,我在容器中使用xtype:text.

http://jsfiddle.net/nCkZN/4/ (这仍然使用表单面板.但这是显示文本颜色不会改变)

Mol*_*Man 6

使用fieldStyle而不是style

演示


更新

我混淆了'text'和'textfield'.

现在我知道了.更改字体样式的唯一方法Ext.draw.Text是使用styleSelector(必须引用有效的css规则)配置它,就像在此演示中完成的那样.