Sencha Touch app appears blank in browser

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 15:41:54

问题


I have a really simple Sencha Touch 2.0.1 app made with Sencha Architect 2.0.0: a list of items loaded from a local json file. If I export it to an APK and install it on my droid, it displays perfectly. However, when I try to preview it in my browser it appears as a blank white screen.

I have tried it in both Chrome and Safari. Safari displayed it perfectly the FIRST time I loaded the page, but I have never gotten it to work again. I tried clearing internet data, to no effect.

Since I have no idea what could be causing this issue, I'm going to post a link to my code rather than list EVERYTHING here. Thanks.

.xda archive: http://www.mediafire.com/?9k2341dtblyq4e1
.zip file: http://www.mediafire.com/?07s6pfa734l3ewi

Perhaps another piece of relevant information is that I'm using WAMPSERVER 2.2 with default config, and I've had this problem with most of my other apps (that use list views) as well.

The CityBars tutorial from Sencha works completely in Chrome, and loads the title bar in Safari but does not load any items to click on. http://docs.sencha.com/architect/2-0/#!/guide/first_mobile_app


回答1:


A couple of things :

Add a these to your list's config :

  fullscreen:true,
  layout:'fit',

Add this to your application's config (app.js) :

launch: function() {
  Ext.Viewport.add({
    xclass: 'MyApp.view.MyNavigationView'
  });
}

Then, the url in your store should probably be :

url: 'data/data.json',

I made it work with these config. Hope this helped

[Download]




回答2:


maybe a bit late but my answer might help somebody else: make sure that the "autoLoad" property of the store you are using in your DataView is "ticked" (this is if you are using Sencha Architect).

Hope it helps.



来源:https://stackoverflow.com/questions/11904012/sencha-touch-app-appears-blank-in-browser

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