Extjs如何更改Ext.form.Label的“样式" [英] Extjs How can I change the 'style' of Ext.form.Label

查看:660
本文介绍了Extjs如何更改Ext.form.Label的“样式"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以在创建标签时设置标签的style属性,但是我想在运行时更改标签的样式,该怎么做?

I know that I can set the style property of the label when creating it, but I want to change the style at run time, how can I do that?

用户选择:字体,颜色,背景色,我想根据用户的需要更改现有的标签样式.

the user pick: font, color, bg color and I want to change the existing label style as user desire.

谢谢你?

推荐答案

您可以应用样式:

yourFormPanel.getForm().findField("field_name").labelEl.setStyle({"color":"red"});

或添加/删除CSS类:

or add/remove css classes:

yourFormPanel.getForm().findField("field_name").labelEl.addCls("red-label");
yourFormPanel.getForm().findField("field_name").labelEl.removeCls("black-label");

这篇关于Extjs如何更改Ext.form.Label的“样式"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆