I use the setTitle inside a function for a dynamic title for my grid.panel and add variables to it.
Is there a way to color only the vars? For example, I want the ondevs to be green.
changeTitle: function(){
var ondevs = 0;
var offdevs = 0;
this.getView().setTitle(Strings.dev + " - " + ondevs + " Online " + offdevs + " Offline");
}
Thanks!
答案 0 :(得分:1)
You can just put any HTML you want into a panel header (panel, formpanel, gridpanel):
Ext.create('Ext.panel.Panel',{
renderTo:Ext.getBody(),
width:300,
height:100,
title:'<span style="color:springgreen">17</span> Online</u>'
});