這裏是我的應用程序代碼:煎茶觸摸2 - 我Ext.List犯規出現
Ext.application({
name: 'ProjectName',
appFolder: APP_URL + "app",
// phoneStartupScreen: 'LOGO.png',
controllers: ['Site_inside'],
views: ['Inside_spotlist'],
models: ['Spot'],
stores: ['Spots'],
launch: function() {
//bootstrap
console.log("inner site bootstrap");
//var spotlist = Ext.create("ProjectName.view.Inside_spotlist");
Ext.Viewport.add({
xclass: 'ProjectName.view.Inside_spotlist'
});
return true;
}
});
查看 'Inside_spotlist' 代碼:
Ext.define('ProjectName.view.Inside_spotlist', {
extend: 'Ext.List',
alias: 'spotlist',
xtype: 'spotlist',
requires: [
'ProjectName.store.Spots'
],
config: {
store: 'Spots',
itemTpl: '{first_name} {last_name}'
},
initialize: function() {
console.log("spolist loaded");
}
});
'現貨' 模式的代碼:
Ext.define("ProjectName.model.Spot", {
extend: 'Ext.data.Model',
config: {
fields: [
{
name: 'firstName',
type: 'string'
},
{
name: 'lastName',
type:'string'
}
]
}
});
最後,斑點店:
Ext.define("ProjectName.store.Spots", {
extend: 'Ext.data.Store',
config: {
listeners: {
load: function() {
console.log("loaded store");
}
},
autoLoad: true,
autoSync: true,
model: 'ProjectName.model.Spot',
data:[
{
firstName: 'test',
lastName: 'test2'
}
]
}
});
它加載正常(出現控制檯消息,沒有錯誤或警告消息),但沒有出現帶有我的測試數據的列表。如果我試圖「上下」抓取站點,右側的iOS風格的滾動條會顯示,但列表中沒有數據。
這段代碼有什麼問題?