roojs-debug.js
authorAlan Knowles <alan@akbkhome.com>
Mon, 21 Nov 2011 09:20:09 +0000 (17:20 +0800)
committerAlan Knowles <alan@akbkhome.com>
Mon, 21 Nov 2011 09:20:09 +0000 (17:20 +0800)
roojs-all.js

roojs-all.js
roojs-debug.js

index 6f9f59c..887da67 100644 (file)
@@ -314,8 +314,7 @@ this.sortToggle={};this.sortOrder=[];Roo.data.Store.superclass.constructor.call(
 this.fireEvent("remove",this,A,B);},removeAll:function(){this.data.clear();if(this.pruneModifiedRecords){this.modified=[];}
 this.fireEvent("clear",this);},insert:function(A,B){B=[].concat(B);for(var i=0,C=B.length;i<C;i++){this.data.insert(A,B[i]);B[i].join(this);}
 this.fireEvent("add",this,B,A);},indexOf:function(A){return this.data.indexOf(A);},indexOfId:function(id){return this.data.indexOfKey(id);},getById:function(id){return this.data.key(id);},getAt:function(A){return this.data.itemAt(A);},getRange:function(A,B){return this.data.getRange(A,B);},storeOptions:function(o){o=Roo.apply({},o);delete o.callback;delete o.scope;this.lastOptions=o;},load:function(A){A=A||{};if(this.fireEvent("beforeload",this,A)!==false){this.storeOptions(A);var p=Roo.apply(A.params||{},this.baseParams);if(!this.reader.metaFromRemote){p._requestMeta=1;}if(this.sortInfo&&this.remoteSort){var pn=this.paramNames;p[pn["sort"]]=this.sortInfo.field;p[pn["dir"]]=this.sortInfo.direction;}if(this.multiSort){var pn=this.paramNames;p[pn["multisort"]]=Roo.encode({sort:this.sortToggle,order:this.sortOrder});}
-this.proxy.load(p,this.reader,this.loadRecords,this,A);}},reload:function(A){this.load(Roo.applyIf(A||{},this.lastOptions));},loadRecords:function(o,A,B){if(!o||B===false){if(B!==false){this.fireEvent("load",this,[],A);}if(A.callback){A.callback.call(A.scope||this,[],A,false);}return;}if(o.success===false){if(!this.hasListener('loadexception')&&typeof(this.reador.jsonData.errorMsg)!='undefined'){Roo.MessageBox.alert("Error loading",this.reader.jsonData.errorMsg);}
-this.fireEvent("loadexception",this,o,A,this.reader.jsonData);return;}var r=o.records,t=o.totalRecords||r.length;if(!A||A.add!==true){if(this.pruneModifiedRecords){this.modified=[];}for(var i=0,C=r.length;i<C;i++){r[i].join(this);}if(this.snapshot){this.data=this.snapshot;delete this.snapshot;}
+this.proxy.load(p,this.reader,this.loadRecords,this,A);}},reload:function(A){this.load(Roo.applyIf(A||{},this.lastOptions));},loadRecords:function(o,A,B){if(!o||B===false){if(B!==false){this.fireEvent("load",this,[],A);}if(A.callback){A.callback.call(A.scope||this,[],A,false);}return;}if(o.success===false){Roo.log("load records failed");this.fireEvent("loadexception",this,o,A,this.reader.jsonData);return;}var r=o.records,t=o.totalRecords||r.length;if(!A||A.add!==true){if(this.pruneModifiedRecords){this.modified=[];}for(var i=0,C=r.length;i<C;i++){r[i].join(this);}if(this.snapshot){this.data=this.snapshot;delete this.snapshot;}
 this.data.clear();this.data.addAll(r);this.totalLength=t;this.applySort();this.fireEvent("datachanged",this);}else {this.totalLength=Math.max(t,this.data.length+r.length);this.add(r);}
 this.fireEvent("load",this,r,A);if(A.callback){A.callback.call(A.scope||this,r,A,true);}},loadData:function(o,A){var r=this.reader.readRecords(o);this.loadRecords(r,{add:A},true);},getCount:function(){return this.data.length||0;},getTotalCount:function(){return this.totalLength||0;},getSortState:function(){return this.sortInfo;},applySort:function(){if(this.sortInfo&&!this.remoteSort){var s=this.sortInfo,f=s.field;var st=this.fields.get(f).sortType;var fn=function(r1,r2){var v1=st(r1.data[f]),v2=st(r2.data[f]);return v1>v2?1:(v1<v2?-1:0);};this.data.sort(s.direction,fn);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(s.direction,fn);}}},setDefaultSort:function(A,B){this.sortInfo={field:A,direction:B?B.toUpperCase():"ASC"};},sort:function(A,B){var f=this.fields.get(A);if(!B){this.sortToggle[f.name]=this.sortToggle[f.name]||f.sortDir;if(this.multiSort||(this.sortInfo&&this.sortInfo.field==f.name)){B=(this.sortToggle[f.name]||"ASC").toggle("ASC","DESC");}else {B=f.sortDir;}}
 this.sortToggle[f.name]=B;this.sortInfo={field:f.name,direction:B};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this);}else {this.load(this.lastOptions);}},each:function(fn,A){this.data.each(fn,A);},getModifiedRecords:function(){return this.modified;},createFilterFn:function(A,B,C){if(!B.exec){B=String(B);if(B.length==0){return false;}
index 2667caa..46f354b 100644 (file)
@@ -19553,10 +19553,8 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, {
         }
         // if data returned failure - throw an exception.
         if (o.success === false) {
-             // show a message if no listener is registered.
-            if (!this.hasListener('loadexception') && typeof(this.reador.jsonData.errorMsg) != 'undefined') {
-                Roo.MessageBox.alert("Error loading",this.reader.jsonData.errorMsg);
-            }
+             Roo.log("load records failed");
+           
             
             
             this.fireEvent("loadexception", this, o, options, this.reader.jsonData);
@@ -19589,6 +19587,7 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, {
         }
     },
 
+
     /**
      * Loads data from a passed data block. A Reader which understands the format of the data
      * must have been configured in the constructor.
@@ -19831,7 +19830,7 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, {
         }
         this.fireEvent("update", this, record, Roo.data.Record.EDIT);
     },
-
+    
     // private
     afterReject : function(record){
         this.modified.remove(record);