PDA

View Full Version : automatic switch between extjs and touch



alex4u2nv
9 Feb 2011, 10:15 AM
Since touch and extjs are two different but similar libraries, I'm guessing that this couldn't be done by toggling the stylesheets.
So I was wondering, how do people handle this situation?
i'm guessing server side browser detection and delivery of the appropriate libraries? Or is there a better way of doing this?

thanks,
Alex.

jay@moduscreate.com
9 Feb 2011, 11:07 AM
Welcome to the forums. Please post post in the proper forums in the future. Moved to Sencha Touch Help.

jay@moduscreate.com
9 Feb 2011, 11:08 AM
I think the best thing is to detect the user agent on the server side and serve up the javascript accordingly.

aw1zard2
9 Feb 2011, 11:44 AM
I posted a function to detect if a mobile browser device was connected or not.
This was posted during Sencha Touch's private beta but I think you can get some hints on how I've been handling things. I check which browser is hitting the system then for that php session load several variables that change my main php template engine to give the correct flow and javascript files to the device connected. Cause remember there is now tablets with Windows 7 and other full Operating Systems that won't be able to handle Sencha Touch but would use Ext JS instead.

I have gone a little bit further and also checking the viewable size but it's not listed in this function and classified my "screens" by device/browser connected and viewable size. The Sencha Touch screens can auto adjust better then a tablet with Windows 7 on it. Of course this will get better as we get browsers able to tell if it's in landscape or portrait modes using Ext JS. Some of the Sencha Touch which handles this might be in Ext JS 4.0 not sure yet will just have to wait and see.

But for a quick test in Ext JS if the viewable height is bigger then the width then your in portrait otherwise landscape. ;)

http://www.sencha.com/forum/showthread.php?99513-How-To-Design-Develop-and-test-for-a-mobile-device-hints-tips-and-tricks.&p=468703&viewfull=1#post468703

:D

alex4u2nv
14 Feb 2011, 9:21 AM
Thanks I will check this out, and utilize some serverside filtering.