admin管理员组文章数量:1402806
I need to change the color of the text below. Everything else in the style field works except for the text color. Can someone tell me what I am doing wrong here?
{
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="";
}
},
EDIT. I am not using a form panel, i am using xtype:text inside a container.
/ (this still uses form panel. But this is to show the text color does not change)
I need to change the color of the text below. Everything else in the style field works except for the text color. Can someone tell me what I am doing wrong here?
{
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="";
}
},
EDIT. I am not using a form panel, i am using xtype:text inside a container.
http://jsfiddle/nCkZN/4/ (this still uses form panel. But this is to show the text color does not change)
Share Improve this question edited Dec 11, 2012 at 18:37 Micheal asked Dec 7, 2012 at 22:03 MichealMicheal 2,33210 gold badges52 silver badges96 bronze badges2 Answers
Reset to default 6use fieldStyle instead of style
demo
Update
I confused 'text' and 'textfield'.
Now I've got it. The only way to change font style of Ext.draw.Text
is to configure it with styleSelector (which has to refer to a valid css rule) like it is done in this demo.
Use The Fill in the Style As below use the type as text (Sprite) instead of using the Xtype as text
Ext.create('Ext.draw.Component', {
renderTo: Ext.getBody(),
width: 200,
height: 200,
items: [{
type: "text",
text: "Hello, Sprite!",
fill: "green",
font: "18px monospace"
}]
});
本文标签: javascriptchange color of xtype text in extjs41Stack Overflow
版权声明:本文标题:javascript - change color of xtype text in extjs4.1 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744117355a2591575.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论