您的位置:首页 > Web前端 > CSS

EXTJS4 设置label 样式

2011-11-22 22:58 162 查看
<style type="text/css"  >
#label2{font-size: 12px; color: #868600;background-color:#808000}
.classDiv1{font-size: 12px; color: #808000; }
.classDiv2{font-size: 12px; color: #EEE000; }
</style>


panel11 =   Ext.create('Ext.form.Panel', {
title: 'Field with Label',
border: true,
width: 400, bodyPadding: 10,
renderTo: Ext.getBody(),
layout: { type: 'hbox', align: 'middle' },
items: [
{ xtype: 'textfield', hideLabel: true, flex: 1 },
{ xtype: 'label',
cls: 'classDiv1',
itemId: 'label1',
text: 'My Awesome Field', margins: '0 0 0 10'
}, { xtype: 'label',
cls: 'classDiv2',
itemId: 'label2',
text: 'My Awesome Field', margins: '0 0 0 10'
}]
});


function SetLabelColor() {
var bb = panel11.getComponent('label1')
//alert(bb);
bb.removeCls('classDiv1');
bb.addCls('classDiv2');
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: