請參閱這些文章以參考「Ext.applyIf」函數和雙管道。ExtJS 4:什麼適用ExtJS代碼中使用兩個管道?
http://docs.sencha.com/core/manual/content/utility.html
http://homepage.ntlworld.com/kayseycarvey/controlflow4.html
誰能解釋這是什麼邏輯在ExtJS的框架做什麼?我想確保我的解釋在管道的第一行(特別是)是正確的。
var params = Ext.applyIf(operation.params || {}, this.extraParams || {}), request;
params = Ext.applyIf(params, this.getParams(params, operation));
if (operation.id && !params.id) {
params.id = operation.id;
}
從ASP.NET ASMX自定義服務器代理類措施:
Ext.define('Ext.ux.AspWebAjaxProxy', {
extend: 'Ext.data.proxy.Ajax',
require: 'Ext.data',
buildRequest: function (operation) {
var params = Ext.applyIf(operation.params || {}, this.extraParams || {}), request;
params = Ext.applyIf(params, this.getParams(params, operation));
if (operation.id && !params.id) {
params.id = operation.id;
}
params = Ext.JSON.encode(params);
request = Ext.create('Ext.data.Request', {
params: params,
action: operation.action,
records: operation.records,
operation: operation,
url: operation.url
});
request.url = this.buildUrl(request);
operation.request = request;
return request;
}
});