PDA

View Full Version : Dynamic CSS/CSS generation



stenlik
2 Dec 2010, 3:49 AM
Hello,

is it possible to dynamically during the script execution generate the CSS class for some component and/or change its content (e.g. background-color) later?

BR
STeN

mitchellsimoens
2 Dec 2010, 6:06 AM
http://dev.sencha.com/deploy/touch/docs/?class=Ext.Element

Look at the addCls, applyStyles, replaceCls, set, setStyle, toggleCls. All these can add/remove classes or attributes. I say attributes because CSS3 can change styles based on attributes.

Creating a CSS class, I don't think so. ExtJS has a util function that can do that but I don't think ST does... without creating the tag manually.

stenlik
2 Dec 2010, 11:22 PM
Hi,

Thanks a lot for the tip.
BR
STeN