PDA

View Full Version : Quick Question: How to use a theme?



BillHubbard
5 Dec 2011, 3:43 PM
This should be an easy question, though I'm having a hell of a time finding the answer...

If I have a theme, or create a new theme, how do I tell my application to use it? And can I switch themes dynamically?

tobiu
5 Dec 2011, 3:47 PM
take a look at:
http://docs.sencha.com/ext-js/4-0/#!/guide/theming


<html>
<head>
<title>Ext Theme</title>

<link rel="stylesheet" type="text/css" href="resources/css/my-ext-theme.css">
<script type="text/javascript" src="extjs/ext-debug.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>


yes you can swap themes dynamically, just make sure that the default ones reset all custom class changes you apply in a custom theme.
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.util.CSS-method-swapStyleSheet

otherwise i recommend to reload.

BillHubbard
5 Dec 2011, 5:43 PM
So, if I can read between the lines here, it appears that what I need to do to apply a theme is to specify the style sheet for a particular theme in HTML. And to change it dynamically, I can call swapStyleSheet.

So, I take it there's no property in the JavaScript where I can specify what theme I want to use - I have to specify it in the HTML and change it using swapStyleSheet. Is this correct?

BillHubbard
12 Dec 2011, 10:27 AM
Bueller?