~cdparra/gelee/trunk

« back to all changes in this revision

Viewing changes to webui/web/extjs/build/data/DirectProxy-min.js

  • Committer: parra
  • Date: 2010-03-15 15:56:56 UTC
  • Revision ID: svn-v4:ac5bba68-f036-4e09-846e-8f32731cc928:trunk/gelee:1448
merged gelee at svn

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Ext JS Library 3.0 RC2
 
3
 * Copyright(c) 2006-2009, Ext JS, LLC.
 
4
 * licensing@extjs.com
 
5
 * 
 
6
 * http://extjs.com/license
 
7
 */
 
8
 
 
9
 
 
10
Ext.data.DirectProxy=function(config){Ext.apply(this,config);if(typeof this.paramOrder=='string'){this.paramOrder=this.paramOrder.split(/[\s,|]/);}
 
11
Ext.data.DirectProxy.superclass.constructor.call(this,config);};Ext.extend(Ext.data.DirectProxy,Ext.data.DataProxy,{paramOrder:undefined,paramsAsHash:true,directFn:undefined,doRequest:function(action,rs,params,reader,callback,scope,options){var args=[];var directFn=this.api[action]||this.directFn;switch(action){case Ext.data.Api.actions.create:args.push(params[reader.meta.root]);break;case Ext.data.Api.actions.read:if(this.paramOrder){for(var i=0,len=this.paramOrder.length;i<len;i++){args.push(params[this.paramOrder[i]]);}}else if(this.paramsAsHash){args.push(params);}
 
12
break;case Ext.data.Api.actions.update:args.push(params[reader.meta.idProperty]);args.push(params[reader.meta.root]);break;case Ext.data.Api.actions.destroy:args.push(params[reader.meta.root]);break;}
 
13
var trans={params:params||{},callback:callback,scope:scope,arg:options,reader:reader};args.push(this.createCallback(action,rs,trans),this);directFn.apply(window,args);},createCallback:function(action,rs,trans){return function(result,res){if(!res.status){if(action===Ext.data.Api.actions.read){this.fireEvent("loadexception",this,trans,res,null);}
 
14
this.fireEvent('exception',this,'remote',action,trans,res,null);trans.callback.call(trans.scope,null,trans.arg,false);return;}
 
15
if(action===Ext.data.Api.actions.read){this.onRead(action,trans,result,res);}else{this.onWrite(action,trans,result,res,rs);}}},onRead:function(action,trans,result,res){var records;try{records=trans.reader.readRecords(result);}
 
16
catch(ex){this.fireEvent("loadexception",this,trans,res,ex);this.fireEvent('exception',this,'response',action,trans,res,ex);trans.callback.call(trans.scope,null,trans.arg,false);return;}
 
17
this.fireEvent("load",this,res,trans.arg);trans.callback.call(trans.scope,records,trans.arg,true);},onWrite:function(action,trans,result,res,rs){this.fireEvent("write",this,action,result,res,rs,trans.arg);trans.callback.call(trans.scope,result,res,true);}});
 
 
b'\\ No newline at end of file'