PDA

View Full Version : Theme



JW
10 May 2007, 3:50 PM
Folks,

I need help with setting different themes. I tried to do the same thing as is being done in the "../layout/complex.html" from the examples. But, unfortunately, the themes does not changes. I did debug example.js

init : function(){
// alert('inisde');
var s = Ext.get('extlib'), t = Ext.get('exttheme');
if(!s || !t){ // run locally?
return;
}
var lib = Cookies.get('extlib') || 'yahoo',
theme = Cookies.get('exttheme') || 'aero';
// alert(theme);
if(lib){
s.dom.value = lib;
}
if(theme){
// alert('inside theme....'+ 'x-'+theme)
t.dom.value = theme;
Ext.get(document.body).addClass('x-'+theme);
}
// alert(s.getValue())
s.on('change', function(){
Cookies.set('extlib', s.getValue());
setTimeout(function(){
window.location.reload();
}, 250);
});
// alert(t.getValue())
t.on('change', function(){
Cookies.set('exttheme', t.getValue());
setTimeout(function(){
window.location.reload();
}, 250);
});
}
};
}();

I am getting the different themes in this function from the dropdown, but the themes on the browser does not change.

Could anyone help me with this? Not sure what I am missing.

Thanks
Joseph

JW
11 May 2007, 11:24 AM
got this working by doing this

Ext.util.CSS.swapStyleSheet('theme', '../ext/resources/css/'+'ytheme-'+theme+'.css');

Thanks!
JW