나는이 예제 같은 가게가있는 경우 :Sencha Touch : HTML 응용 프로그램 캐시의 데이터를 저장소에로드 하시겠습니까?
var myStore = Ext.create("Ext.data.Store", {
model: "User",
proxy: {
type: "ajax",
url : "/users.json",
reader: {
type: "json",
rootProperty: "users"
}
},
autoLoad: true
});
내가 응용 프로그램 캐시에 users.json
파일을 캐시 할, 그래서 다음과 같이 내가 app.json
에 추가 :
/**
* Used to automatically generate cache.manifest (HTML 5 application cache manifest) file when you build
*/
"appCache": {
/**
* List of items in the CACHE MANIFEST section
*/
"cache": [
"index.html",
"users.json"
],
/**
* List of items in the NETWORK section
*/
"network": [
"*"
],
/**
* List of items in the FALLBACK section
*/
"fallback": []
},
크롬에서 상대를 개발자 도구를 사용하면 .json 파일이 index.html과 함께 응용 프로그램 캐시에 올바르게 추가되었음을 알 수 있습니다.
나는 오프라인에서 '그냥 작동'할 것으로 기대합니다. 안타깝게도 json 파일을 요청하려고 시도합니다. json 파일은 오프라인 일 때 작동하지 않으며 응용 프로그램에서 해당 데이터를 더 이상 사용하지 않습니다.
나머지 응용 프로그램은 완벽하게 작동합니다. 어떤 아이디어?