/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/Projects/Packer/
*/

// V:\1.1.007\js\lib\ext-namirial\Ext.ux.Namirial.data.GearsStore.js

Ext.namespace('Ext.ux','Ext.ux.Namirial','Ext.ux.Namirial.data');Ext.ux.Namirial.data.GearsStore=Ext.extend(Ext.data.JsonStore,{constructor:function(c){Ext.ux.Namirial.data.GearsStore.superclass.constructor.call(this,Ext.apply(c,{root:'rows',totalProperty:'totalRows',gearsConn:c.gearsConn,selectFrom:c.selectFrom,tableId:c.tableId,cfisc:c.cfisc||false,selectFilter:c.selectFilter,remoteSort:true,fields:c.fields,autoCommit:c.autoCommit||false}));this.proxy=new Ext.data.SqlDB.Proxy(c.gearsConn,c.selectFrom,c.tableId,this);this.proxy.enableAutoCommit(this.autoCommit);},load:function(options){options=options||{params:{}};if((this.selectFrom=='')||(this.fields.length==0))
return false;var clause=((this.cfisc)?("CFISC = '"+this.cfisc+"'"):(""))+(this.selectFilter||"");Ext.apply(options.params,{fields:this.fields,where:(clause!='')?('WHERE '+clause):''});return Ext.ux.Namirial.data.GearsStore.superclass.load.call(this,options);},setAutoCommit:function(state){this.proxy.enableAutoCommit(state);},commitChanges:function(autoCommit){var m=this.modified.slice(0);this.modified=[];for(var i=0,len=m.length;i<len;i++){m[i].commit();}},stringSum:function(property,start,end){var rs=this.data.items,v=0;start=start||0;end=(end||end===0)?end:rs.length-1;for(var i=start;i<=end;i++){var value=rs[i].data[property]
var field=this.fields.get(property);if(Ext.type(value)=='string')
value=parseFloat(value.replace(/,/g,'.'))
v+=(value||0);}
return v;}})

