PDA

View Full Version : Ext JS and Touch Integration



Mark Wagoner
20 Nov 2013, 10:05 AM
I wasn't sure if this should be posted here or in the Sencha Touch forum. Please let me know if this is not the appropriate place.

We have been evaluating Ext JS and have found that it works good on the desktop but is not ideal on a tablet. This is primarily due to the big difference in screen sizes. So we are wondering what are the possibilities to integrate Ext JS with Sencha Touch?

Obviously we don't want to create two separate apps if at all possible. If we follow the MVC architecture and place our models, views and controllers in separate source files, is it possible to swap the view components based on the client and reuse the model and controller logic?

Any documents on if/how this has been done before would be a great help.

Thanks,
Mark Wagoner

scottmartin
22 Nov 2013, 6:21 AM
The good news is we are moving in this direction as described here: (tap support)
http://www.sencha.com/blog/ext-js-on-tap/

As for mixing the apps, they are different API's

Your options are to create Ext and Touch apps, or in our case in a recent app, we tested the device type and created an alternate view for the mobile device.

Mark Wagoner
22 Nov 2013, 6:40 AM
Thanks for the info Scott. It is at least good to know we are not alone in this. Being new to Sencha, is there any how-to's,lessons learned, etc. on detecting the device and creating an alternate view? Does this translate into a lot of work? Thanks again.

scottmartin
22 Nov 2013, 7:26 AM
You can check the userAgent string:

http://www.abeautifulsite.net/blog/2011/11/detecting-mobile-devices-with-javascript/


any: function() {
return navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i);
}


There is also mention of checking for touch support to test as well.


var hasTouch = 'ontouchstart' in document.documentElement;