0
Ext.define('MyApp.model.Facility', {
extend: 'Ext.data.Model',
requires: [
'Ext.data.proxy.Ajax'
],
config: {
fields: [
{
name: 'FacilityId'
},
{
name: 'FacilityName'
}
]
}
});
Ext.define('MyApp.store.FacilityStore', {
extend: 'Ext.data.Store',
requires: [
'MyApp.model.Facility'
],
config: {
autoLoad: true,
model: 'MyApp.model.Facility',
storeId: 'FacilityStore',
proxy: {
type: 'ajax',
batchActions: false,
url: 'http://localhost/QuickFind/Services/EquipmentService.asmx/GetFacilities',
headers: {
'content-type': 'application/json'
},
reader: {
type: 'json',
rootProperty: 'd'
}
}
}
});
而且數據試圖加載到列表中。Sench觸摸列表不渲染數據
Ext.define('MyApp.view.facilityList', {
extend: 'Ext.dataview.List',
alias: 'widget.facilityList',
config: {
docked: 'top',
height: 200,
id: 'datalist',
ui: 'round',
scrollable: true,
store: 'FacilityStore',
onItemDisclosure: true,
itemTpl: [
'<div><p>{Facility.FacilityName}</p></div>'
]
}
});
和我的控制器推出我是數據綁定到列表:
Ext.define( 'MyApp.controller.Facility',{ 延長: 'Ext.app.Controller',
config: { refs: { dataList: '#dataList', mainNav: 'mainNav' } }, launch: function() { var me = this; debugger; Ext.getStore('FacilityStore').load(); var group_store = Ext.getStore("FacilityStore"); me.facilityList.setStore(group_store); }
店裝有記錄,但它不能在列表中顯示。