PDA

View Full Version : [CLOSED] Detect tablet or mobile phone



matt
Jan 15, 2015, 1:42 PM
Hi,

How to detect if my code is running on Tablet or other mobile device ?
How can I change my theme if tabled or mobile device was detected ?

Thank you

Sergei
Jan 15, 2015, 3:16 PM
Hi,



How to detect if my code is running on Tablet or other mobile device?


You can detect platform using this class.
http://docs.sencha.com/extjs/5.0.1/#!/api/Ext.os

Daniil
Jan 15, 2015, 7:40 PM
Hello,

There is also the RequestManager server class that you can use. For example,

RequestManager.IsAndroid

To apply a theme, please use a ResourceManager's Theme property.

matt
Jan 16, 2015, 10:14 AM
Thank you Danill,

That works for me. I could not find Theme property in ResourceManager but found it here:


Ext.Net.GlobalConfig.Settings.Theme

Please close.

Daniil
Jan 16, 2015, 10:26 AM
I could not find Theme property in ResourceManager

I guess you looked at the static properties of the ResourceManager class, but it is a property of instance.

X.ResourceManager.Theme = Ext.Net.Theme.Crisp;

matt
Jan 16, 2015, 10:31 AM
Thank you... actually I had one more question... how to recognize theme in JavaScript...

I can see that Ext.theme is always "Default"

Daniil
Jan 16, 2015, 11:24 AM
Please use:

Ext.net.ResourceMgr.theme