extjs-form

Extjs How can I change the 'style' of Ext.form.Label

橙三吉。 提交于 2019-12-11 05:17:17
问题 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. thank you? 回答1: You can apply styles: yourFormPanel.getForm().findField("field_name").labelEl.setStyle({"color":"red"}); or add/remove css classes: yourFormPanel.getForm().findField("field_name").labelEl.addCls("red-label"); yourFormPanel.getForm().findField(