itemId: 'label',
data: {
title: '',
- usage: ''
+ usage: '',
+ iconCls: undefined
},
- tpl: '<div class="left-aligned">{title}</div><div class="right-aligned">{usage}</div>'
+ tpl: [
+ '<div class="left-aligned">',
+ '<tpl if="iconCls">',
+ '<i class="{iconCls}"></i> ',
+ '</tpl>',
+ '{title}</div> <div class="right-aligned">{usage}</div>'
+ ]
},
{
height: 2,
me.getComponent('progress').setVisible(enable);
},
+ setIconCls: function(iconCls) {
+ var me = this;
+ me.getComponent('label').data.iconCls = iconCls;
+ },
+
updateValue: function(text, usage) {
var me = this;
var label = me.getComponent('label');
me.getComponent('progress').setVisible(me.printBar);
me.updateValue(me.text, me.value);
+ me.setIconCls(me.iconCls);
}
});