Created
August 16, 2012 15:01
-
-
Save aghuddleston/3370841 to your computer and use it in GitHub Desktop.
Ext JS 4 Proxy that puts params in JSON format, that can be used by Stores.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('Ext.ux.data.proxy.JsonAjaxProxy', { | |
extend:'Ext.data.proxy.Ajax', | |
alias:'proxy.jsonajax', | |
actionMethods : { | |
create: "POST", | |
read: "POST", | |
update: "POST", | |
destroy: "POST" | |
}, | |
buildRequest:function (operation) { | |
var request = this.callParent(arguments); | |
// For documentation on jsonData see Ext.Ajax.request | |
request.jsonData = request.params; | |
request.params = {}; | |
return request; | |
}, | |
/* | |
* @override | |
* Inherit docs. We don't apply any encoding here because | |
* all of the direct requests go out as jsonData | |
*/ | |
applyEncoding: function(value){ | |
return value; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good to know, thanks!