Sencha Touch & ExtJS profiles for desktop and mobile in one web project/vhost?

喜你入骨 提交于 2019-12-03 22:15:20

I recently had the same situation. I have a single c# controller that returns the desktop or mobile index.html based on useragent. It all appears as http://www.mydomain.tld and runs under a single IIS site. Since all the calls are AJAX to REST, they share the same server code. It's only the view that changes. The same could be done with any other server and language.

My structure is:

Root
 |_desktop
 |   |_app
 |   |_lib
 |   |_resources
 |_mobile
 |   |_app
 |   |_lib
 |   |_resources
 |_shared
     |_localization.js (generic JS objects)
     |_proto.js (my generic prototype functions)

Right now, no it's not realistic to have everything in the same project.

Ext JS and Touch, despite having similar APIs, do not have the same API. Therefore you likely cannot share any code between the frameworks (currently Ext JS 4.1.3 and Touch 2.1.0 are the latest releases).

Therefore, since you're ultimately writing separate apps, I'd keep them totally separate code bases.

As for your domain/vhost question... you could configure your server either way, I don't know if that matters so much in my opinion.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!