0
rally app builder 및 App-debug.html을 사용하여 외부에서 앱을 실행하고 있습니다. 별도의 js 파일에 데이터 저장소를 정의했습니다. App.js가 상점에 액세스하도록하려면 어떻게합니까? 저장소가 정의되지 않았다는 오류가 나타납니다.사용자 정의 앱을 여러 개의 js 파일로 분해하는 방법
rally app builder 및 App-debug.html을 사용하여 외부에서 앱을 실행하고 있습니다. 별도의 js 파일에 데이터 저장소를 정의했습니다. App.js가 상점에 액세스하도록하려면 어떻게합니까? 저장소가 정의되지 않았다는 오류가 나타납니다.사용자 정의 앱을 여러 개의 js 파일로 분해하는 방법
다음은 예입니다. 각 파일에는 Ext.define()
으로 정의 된 클래스가 있습니다.
App.js :
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
items:{ html:'<a href="https://help.rallydev.com/apps/2.0rc2/doc/">App SDK 2.0rc2 Docs</a>'},
launch: function() {
var s = Ext.create('MyStore');
var myStore = s._createStore();
console.log(myStore);
}
});
MyStore.js :
Ext.define('MyStore', {
_createStore: function(){
return Ext.create('Rally.data.WsapiDataStore', {
model: 'User Story',
fetch: ['FormattedID','Name'],
pageSize: 100,
autoLoad: true,
context:{
project: '/project/1791267822',
}
});
}
});
config.json :
{
"name": "MyApp",
"className": "CustomApp",
"server": "https://rally1.rallydev.com",
"sdk": "2.0rc2",
"javascript": [
"App.js",
"MyStore.js"
],
"css": [
"app.css"
]
}