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

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?

5 Dec 2011, 3:47 PM
take a look at:

<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>

yes you can swap themes dynamically, just make sure that the default ones reset all custom class changes you apply in a custom theme.

otherwise i recommend to reload.

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?

12 Dec 2011, 10:27 AM