0
如果我有附加到Ext.grid.GridPanel的商店,並且我從服務器返回錯誤,如何將響應中的信息傳遞給用戶?如何在ExtJS4 GridPanel中保存更改時顯示錯誤?
因此,例如
Ext.define('BC.data.Model.DnsZoneFile', {
extend: 'Ext.data.Model',
fields: [
{ name :'dnsZoneFileId'},
{ name :'origin'},
{ name :'serialNumber', type: 'int', defaultValue: 2011122001},
{ name :'status', defaultValue: 'PENDING_UPLOAD'},
{ name :'clientId', type: 'int', defaultValue: 1},
{ name :'ttl', type: 'int', defaultValue: 120}
],
idProperty: 'dnsZoneFileId',
idgen: {
type: 'sequential',
seed: 1,
prefix: 'New'
},
proxy: {
type: 'ajax',
api: {
create : '/dns/zone-file/xhr-put',
read : '/dns/zone-file/xhr-get',
update : '/dns/zone-file/xhr-post',
destroy: '/dns/zone-file/xhr-delete'
},
reader: {
type: 'json',
root: 'zoneFiles',
totalProperty: 'total'
},
writer: {
type: 'json',
allowSingle: false
}
}
});
我怎麼能指定一個回調來處理,如果在/dns/zone-file/xhr-put
API返回某種錯誤?