今天在论坛看到有朋友问我,网站上的换肤功能是如何做的。其实换肤的方法在下载回来的例子中是已经存在的了。但是不知道为什么该功能在ext 2.02下并不可用。
要加上换肤功能主要有两个步聚:
1、在html页面(每一个例子)的body中间加上以下代码(换肤工具条)
- <divid="lib-bar"class="x-toolbar"style="border-width:01px1px;text-align:right;width:150px;position:absolute;right:0px;left:auto;top:2px;"><divid="lib-bar-inner">
- <span>Theme:</span>
- <selectid="exttheme">
- <optionvalue="default">ExtBlue</option>
- <optionvalue="gray">GrayTheme</option>
- <optionvalue="black">BlackTheme</option>
- <optionvalue="green">GreenTheme</option>
- <optionvalue="calista">CalistaTheme</option>
- <optionvalue="darkgray">DarkgrayTheme</option>
- <optionvalue="indigo">IndigoTheme</option>
- <optionvalue="midnight">MidnightTheme</option>
- <optionvalue="olive">OliveTheme</option>
- <optionvalue="pink">PinkTheme</option>
- <optionvalue="purple">PurpleTheme</option>
- <optionvalue="slate">SlateTheme</option>
- <optionvalue="slickness">SlicknessTheme</option>
- </select></div></div>
2、更改 ./examples/examples.js 文件中的 40行
将Ext.getBody().addClass('x-'+theme);
改为Ext.util.CSS.swapStyleSheet("theme", "../../resources/css/xtheme-" + theme + ".css");
完成这两步后就大功告成了!