From 3b4162189fbbdf3c9cb30143b8e092d0f1040a09 Mon Sep 17 00:00:00 2001 From: Emmanuel Kasper Date: Mon, 27 Apr 2015 13:50:31 +0200 Subject: [PATCH] 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 --- www/manager5/data/PVEProxy.js | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/www/manager5/data/PVEProxy.js b/www/manager5/data/PVEProxy.js index 219a620c..f609423d 100644 --- a/www/manager5/data/PVEProxy.js +++ b/www/manager5/data/PVEProxy.js @@ -1,31 +1,29 @@ Ext.define('PVE.RestProxy', { extend: 'Ext.data.RestProxy', alias : 'proxy.pve', + + pageParam : null, + startParam: null, + limitParam: null, + groupParam: null, + sortParam: null, + filterParam: null, + noCache : false, + afterRequest: function(request, success) { + this.fireEvent('afterload', this, request, success); + return; + }, constructor: function(config) { - var me = this; - config = config || {}; - - Ext.applyIf(config, { - pageParam : null, - startParam: null, - limitParam: null, - groupParam: null, - sortParam: null, - filterParam: null, - noCache : false, + Ext.applyIf(config, { reader: { type: 'json', root: config.root || 'data' }, - afterRequest: function(request, success) { - me.fireEvent('afterload', me, request, success); - return; - } }); - me.callParent([config]); + this.callParent([config]); } }, function() {