Extjs中如何改变控件字体的颜色 改变下面checkbox中“水稻”、“小麦”、“油菜”的字体颜色用什么属性?找了半天没找到 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用firebug找DOM结构直接操作css<style>.x-form-cb-label{ color:red;}</style> 根据checkbox的id用脚本修改:Ext.select("label.x-form-cb-label[for=checkboxID]").item(0).dom.style.color = 'red';<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" /><script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script><script type="text/javascript" src="extjs/ext-all.js"></script><script>Ext.onReady(function(){ oForm = new Ext.FormPanel({ renderTo:"form_panel", layout:"form", hideLabels:true, border:false, items:[ {xtype:'checkbox',id:'x1',inputValue:'x',boxLabel:'水稻'}, {xtype:'checkbox',id:'x2',inputValue:'x',boxLabel:'小麦'} ] }); Ext.select("label.x-form-cb-label[for=x1]").item(0).dom.style.color = 'red';});</script><div id="form_panel"></div> <style> .required .x-form-item-label {font-weight:bold;color:red;}</style>增加属性itemCls:'required' 声明对象时的小问题 横向菜单li把下面内容向下挤怎么办? extjs 打开窗体的布局是以viewport布局,如何在关闭viewport页面时提示,是否关闭 javascript调用PrintDocument方法打印 简单的字符串操作 如何在一个js文件里包含另一个文件 当onchange的时候提交表单 在线编辑超文本的控件哪里有啊? 你答对我给分 JSP与mysql之间乱码问题 如何判断网址是否存在,能打开? 一个注册窗口,怎样能够让js验证全部同时做出判断
.x-form-cb-label{
color:red;
}
</style>
Ext.select("label.x-form-cb-label[for=checkboxID]").item(0).dom.style.color = 'red';
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
<script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="extjs/ext-all.js"></script>
<script>
Ext.onReady(function(){
oForm = new Ext.FormPanel({
renderTo:"form_panel",
layout:"form",
hideLabels:true,
border:false,
items:[
{xtype:'checkbox',id:'x1',inputValue:'x',boxLabel:'水稻'},
{xtype:'checkbox',id:'x2',inputValue:'x',boxLabel:'小麦'}
]
});
Ext.select("label.x-form-cb-label[for=x1]").item(0).dom.style.color = 'red';
});</script>
<div id="form_panel"></div>
<style>
.required .x-form-item-label {font-weight:bold;color:red;}
</style>增加属性
itemCls:'required'