ext5migration: move afterRequest() declaration

and default values from constructor to class body, needed fix for

"Cannot override method afterRequest on Ext.data.proxy.Ajax instance"

error. See:

https://fiddle.sencha.com/#fiddle/lpe for test fiddle
http://bit.ly/1HJJ0Ej for background
This commit is contained in:
Emmanuel Kasper 2015-04-27 13:50:31 +02:00 committed by Dietmar Maurer
parent 64c42e0278
commit 3b4162189f

View File

@ -2,30 +2,28 @@ Ext.define('PVE.RestProxy', {
extend: 'Ext.data.RestProxy', extend: 'Ext.data.RestProxy',
alias : 'proxy.pve', alias : 'proxy.pve',
constructor: function(config) { pageParam : null,
var me = this; startParam: null,
limitParam: null,
groupParam: null,
sortParam: null,
filterParam: null,
noCache : false,
afterRequest: function(request, success) {
this.fireEvent('afterload', this, request, success);
return;
},
config = config || {}; constructor: function(config) {
Ext.applyIf(config, { Ext.applyIf(config, {
pageParam : null,
startParam: null,
limitParam: null,
groupParam: null,
sortParam: null,
filterParam: null,
noCache : false,
reader: { reader: {
type: 'json', type: 'json',
root: config.root || 'data' root: config.root || 'data'
}, },
afterRequest: function(request, success) {
me.fireEvent('afterload', me, request, success);
return;
}
}); });
me.callParent([config]); this.callParent([config]);
} }
}, function() { }, function() {