setIconClass for tabs wont recognize my string in a variable. in the below example if "Flagged" is sent to loadFolder, the title changes, but not the icon. I tried tabs.getItem(0).setIconClass(FlaggedIconCls) in firebug, and it worked, i tried the same in the function, it worked....it just wont work when i send a variable (icon in this example)...am i missing something here?
Code:
var FlaggedIconCls = 'flag';
function loadFolder(name)
{
mailStore.proxy.setUrl('get' + name + '.php');
mailStore.load();
//console.log(tabs.getItem(0));
mailStore.on({
'load':{
fn: function()
{
var icon = name + 'IconCls';
tabs.getItem(0).setTitle(name, icon);
//var icon = name + 'IconCls';
//tabs.getItem(0).setIconClass(icon);
console.log(icon);
},
scope:this
},
'loadexception':{
//consult the API for the proxy used for the actual arguments
fn: function(obj, options, response, e){
console.info('store loadexception, arguments:', arguments);
console.info('error = ', e);
},
scope:this
}
});
};
Thanks