Change Global theme - Ext JS

本文讨论了如何在应用程序中通过菜单选项更改主题样式,并提供了具体的实现方法。文中提到了使用Ext.util.CSS.swapStyleSheet方法来动态替换样式表,以实现不同主题间的快速切换。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Hi All !

First of all , congratulations Jack on a great piece of work !

Second :lol:

you're menu example got me thinking
now that you added multiple themes
how can we change the theme of an application from a menu :?:
or is that even possible :?:

thanks and keep up the good work !
Reply With Quote
  #2  
Old 02-21-2007, 01:12 AM
Default

If you were to give the theme style element an ID:

<link rel="stylesheet" id="theme" href="../css/ytheme-gray.css" />

Then you can call:

Ext.util.CSS.swapStyleSheet('theme', '../css/ytheme-aero.css');

If any BasicDialogs are visible, they may not update correctly without a call to syncBodyHeight. Also, Opera appears to need a window resize in order to apply the new styles.
Reply With Quote
  #3  
Old 02-21-2007, 01:25 AM
DefaultOMG

Thanks Jack
you really are the greatest !!!!!!

it works !!!!

check this out
http://86.106.94.205/test/

PS

is there any other way i can donate :?:
cause I live in Romania and i cannot create a paypal account

in the mean time i'll try to help the forum
[/url]
Reply With Quote
  #4  
Old 02-21-2007, 01:29 AM
Default

Nice. Seeing it reminds me the toolbar is dying for a new look in the default theme!

As for contributing, if you can build any example/tutorial files that is always a huge contribution!
Reply With Quote
  #5  
Old 02-21-2007, 09:30 AM
Default

I just wanted to chime in to say that the theme switcher does work without a hitch.

If you explicitly have a css theme in your html and then wish to remove it, and thereby revert to the default theme, you have to put an ID on your <link /> declaration.
Reply With Quote
  #6  
Old 02-21-2007, 09:43 AM
Default

You don't have to have a paypal account to donate. You can donate via a credit card using the paypal web site, it does not require an account.
Reply With Quote
  #7  
Old 02-22-2007, 04:42 AM
Default

Hi Jack,

I have one menubar and a context menu in the same page. But I want to use the default theme for context menu and different custom theme for menubar menu. How do I acheive this...?

Thanks,
Thameem
Reply With Quote
  #8  
Old 02-22-2007, 04:56 AM
Default

Quote:
Originally Posted by jacksloc
If you were to give the theme style element an ID:

<link rel="stylesheet" id="theme" href="../css/ytheme-gray.css" />

Then you can call:

Ext.util.CSS.swapStyleSheet('theme', '../css/ytheme-aero.css');

If any BasicDialogs are visible, they may not update correctly without a call to syncBodyHeight. Also, Opera appears to need a window resize in order to apply the new styles.
I don't find the 'swapStyleSheet' under the new alpha API documentation. Is it public or should i go thru the code and find out ??

Also please let me know or make a tutorial about how to use the themes as it is very important to many users. If we want to use the theme do i need to import the ext-all.css or just the theme css?

Thanks,
Thameem
Reply With Quote
  #9  
Old 02-22-2007, 05:08 AM
Default

dont trust the API docs yet....
the only thing you can trust right now is the actual code.... go dig !



edit: horrible spelling error
Reply With Quote
  #10  
Old 02-22-2007, 05:45 AM
Default

thameema,

Every example uses a different theme. If you look at the source, I'm sure you will be able to figure it out.
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值