0
我正在使用ExtJS MVC並實現Scheduler。combobox的值不在extjs中加載MVC
我想在我的組合框中加載我的商店,但未成功加載。
我的店是
Ext.define('gantt.store.serviceStore', {
extend: 'Ext.data.Store',
model: 'gantt.model.Service',
storeId: 'serviceStore',
autoLoad: true,
autoSync: true,
proxy: {
type: 'ajax',
api: {
read: 'Event/Get'
},
reader: {
type: 'json',
root: 'data'
},
writer: {
type: 'json',
encode: true,
writeAllFields: true,
root: 'data'
}
}
});
我的模型是
Ext.define('gantt.model.Service', {
extend: 'Sch.model.Event',
fields: [{ name: 'ServiceId' },
{ name: 'ServiceName' },
{ name: 'Description' },
{ name: 'Rate' }
],
proxy: {
type: 'ajax',
api: {
read: 'Service/Get'
},
reader: {
type: 'json',
root: 'data'
},
writer: {
root: 'data',
type: 'json',
encode: true,
writeAllFields: true
}
}
});
和我的組合框代碼如下..
this.combo = new Ext.form.ComboBox({
id: 'statesCombo',
store: 'serviceStore',
displayField: 'ServiceName',
valueField: 'ServiceName',
hiddenName: 'ServiceId',
typeAhead: true,
mode: 'local',
fieldLabel: 'Services',
anchor: '100%',
forceSelection: true,
triggerAction: 'all',
emptyText: 'Select a Service',
selectOnFocus: true })
我的問題是,當我點擊在組合框上我的價值是沒有加載.. 並沒有顯示任何錯誤。
你看到通信嘗試到您的服務器? – sha 2012-03-13 20:45:46
其實我正在創建調度程序,但是當我點擊組合框時,它會調用**事件獲取**而不是**服務獲取**。它不會與服務器 – Smily 2012-03-14 06:46:15