git.ithinksw.org
/
extjs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upgrade to ExtJS 3.2.1 - Released 04/27/2010
[extjs.git]
/
src
/
data
/
Api.js
diff --git
a/src/data/Api.js
b/src/data/Api.js
index
ded82ee
..
1b96c1e
100644
(file)
--- a/
src/data/Api.js
+++ b/
src/data/Api.js
@@
-1,6
+1,6
@@
/*!
/*!
- * Ext JS Library 3.
0.3
- * Copyright(c) 2006-20
09 Ext JS, LLC
+ * Ext JS Library 3.
2.1
+ * Copyright(c) 2006-20
10 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
* licensing@extjs.com
* http://www.extjs.com/license
*/
@@
-65,8
+65,7
@@
restActions : {
/**
* Returns true if supplied action-name is a valid API action defined in <code>{@link #actions}</code> constants
/**
* Returns true if supplied action-name is a valid API action defined in <code>{@link #actions}</code> constants
- * @param {String} action
- * @param {String[]}(Optional) List of available CRUD actions. Pass in list when executing multiple times for efficiency.
+ * @param {String} action Action to test for availability.
* @return {Boolean}
*/
isAction : function(action) {
* @return {Boolean}
*/
isAction : function(action) {
@@
-98,7
+97,7
@@
restActions : {
/**
* Returns true if the supplied API is valid; that is, check that all keys match defined actions
* otherwise returns an array of mistakes.
/**
* Returns true if the supplied API is valid; that is, check that all keys match defined actions
* otherwise returns an array of mistakes.
- * @return {String[]|
|
true}
+ * @return {String[]|true}
*/
isValid : function(api){
var invalid = [];
*/
isValid : function(api){
var invalid = [];
@@
-169,7
+168,8
@@
new Ext.data.HttpProxy({
proxy.api[action] = proxy.api[action] || proxy.url || proxy.directFn;
if (typeof(proxy.api[action]) == 'string') {
proxy.api[action] = {
proxy.api[action] = proxy.api[action] || proxy.url || proxy.directFn;
if (typeof(proxy.api[action]) == 'string') {
proxy.api[action] = {
- url: proxy.api[action]
+ url: proxy.api[action],
+ method: (proxy.restful === true) ? Ext.data.Api.restActions[action] : undefined
};
}
}
};
}
}
@@
-183,7
+183,8
@@
new Ext.data.HttpProxy({
restify : function(proxy) {
proxy.restful = true;
for (var verb in this.restActions) {
restify : function(proxy) {
proxy.restful = true;
for (var verb in this.restActions) {
- proxy.api[this.actions[verb]].method = this.restActions[verb];
+ proxy.api[this.actions[verb]].method ||
+ (proxy.api[this.actions[verb]].method = this.restActions[verb]);
}
// TODO: perhaps move this interceptor elsewhere? like into DataProxy, perhaps? Placed here
// to satisfy initial 3.0 final release of REST features.
}
// TODO: perhaps move this interceptor elsewhere? like into DataProxy, perhaps? Placed here
// to satisfy initial 3.0 final release of REST features.
@@
-195,16
+196,18
@@
new Ext.data.HttpProxy({
});
switch (response.status) {
});
switch (response.status) {
- case 200: // standard 200 response, send control back to HttpProxy#onWrite
+ case 200: // standard 200 response, send control back to HttpProxy#onWrite
by returning true from this intercepted #onWrite
return true;
break;
case 201: // entity created but no response returned
return true;
break;
case 201: // entity created but no response returned
- //res[reader.meta.successProperty] = true;
- res.success = true;
+ if (Ext.isEmpty(res.raw.responseText)) {
+ res.success = true;
+ } else {
+ //if the response contains data, treat it like a 200
+ return true;
+ }
break;
case 204: // no-content. Create a fake response.
break;
case 204: // no-content. Create a fake response.
- //res[reader.meta.successProperty] = true;
- //res[reader.meta.root] = null;
res.success = true;
res.data = null;
break;
res.success = true;
res.data = null;
break;
@@
-212,13
+215,6
@@
new Ext.data.HttpProxy({
return true;
break;
}
return true;
break;
}
- /*
- if (res[reader.meta.successProperty] === true) {
- this.fireEvent("write", this, action, res[reader.meta.root], res, rs, o.request.arg);
- } else {
- this.fireEvent('exception', this, 'remote', action, o, res, rs);
- }
- */
if (res.success === true) {
this.fireEvent("write", this, action, res.data, res, rs, o.request.arg);
} else {
if (res.success === true) {
this.fireEvent("write", this, action, res.data, res, rs, o.request.arg);
} else {
@@
-255,7
+251,7
@@
Ext.data.Response.prototype = {
return this.success;
},
getStatus : function() {
return this.success;
},
getStatus : function() {
- return this.status
+ return this.status
;
},
getRoot : function() {
return this.root;
},
getRoot : function() {
return this.root;