[Grid] xtype : 'label' 标题样式设置

[ 417 查看 / 2 回复 ]

xtype : 'label' 标题样式设置
我在grid 的tbar 里面加了个 xtype : 'label', 设置了个id 然后我在别的地方通过id来取到这个组件并设置了标题,我要在标题里面拼出统计的数据,但拼出来后,不能设置样式了:

tbar : [{
        xtype : 'label',
        id : 'countItem'
        }],
var text = '条目变化【  添加: ' + add_item + '条  修改: '+ mod_item + '条  删除:'+ del_item + '条】';
      Ext.getCmp('countItem').setText(text);

我现在要设置这 个标题的样式,该如何设置啊,我在里面加入了<span style="margin-left:50px;color:red"></span> 好像没反应,大家帮帮我弄下,谢谢了!
TOP
xtype : 'label' 标题样式设置

中间的 add_item 等参数是结果,要显示的数据
TOP
xtype : 'label' 标题样式设置

tbar : [{
        xtype : 'label',
        id : 'countItem',
        cls:'自定义样式'

        }],
采用自定义样式试试
TOP