forked from RallyCommunity/rally-massive-dependency-tables
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pxs-overrides.js
42 lines (38 loc) · 1.15 KB
/
pxs-overrides.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Override to try to force POST for queryies instead of a GET so we're not
* constrained to URL.
*
* NOTE: THIS DOES NOT WORK WHEN RUN OUTSIDE OF RALLY!
*/
Ext.override(Ext.data.proxy.Rest,{
actionMethods: {
create : 'POST',
read : 'POST',
update : 'PUT',
destroy: 'DELETE'
},
headers: { 'Content-Type': 'application/json' }
});
Ext.override(Rally.data.lookback.SnapshotRestProxy,{
buildRequest: function(operation) {
var request = this.callParent(arguments);
Ext.apply(request.params, {
fields: this._encodeFetch(),
hydrate: this._encodeHydrate(),
pagesize: operation.limit,
start: operation.start
});
//Always encode filters
if (!request.params[this.filterParam]) {
request.params[this.filterParam] = this.encodeFilters(this.filters, this.rawFind);
}
// encode for packaging
request.params = Ext.JSON.encode(request.params);
return request;
}
});
// Ext.override(Ext.data.proxy.Ajax,{
// getMethod: function(request) {
// return "POST";
// }
// });