Ext.namespace('K.kreports.standardview');Ext.define('K.kreports.standardview.aD',{extend:'Ext.data.Model',fields:FieldsArray});K.kreports.standardview.store=new Ext.data.Store({id:'store',model:K.kreports.standardview.aD,reCount:false,whereConditions:null,proxy:new Ext.data.HttpProxy({actionMethods:{create:"POST",read:"POST",update:"POST",destroy:"POST"},url:'index.php?module=KReports&action=load_report&to_pdf=true',method:'POST',timeout:120000,extraParams:{requester:document.getElementById('recordid').value}}),reader:new Ext.data.reader.Json({root:'records',totalProperty:'count'}),remoteSort:true,listeners:{load:function(){if(K.kreports.standardview.store.reCount==true){bm();K.kreports.standardview.store.reCount=false;}}}});var aS='Synchronous';var ba=25;if(document.getElementById('listtypeproperties').value!=''){listTypeProperties=Ext.JSON.decode(document.getElementById('listtypeproperties').value);if(listTypeProperties.standardViewProperties!=undefined&&listTypeProperties.standardViewProperties.processCount!=undefined&&listTypeProperties.standardViewProperties.processCount!='')aS=listTypeProperties.standardViewProperties.processCount;else aS='Synchronous';if(listTypeProperties.standardViewProperties!=undefined&&listTypeProperties.standardViewProperties.listEntries!=undefined&&listTypeProperties.standardViewProperties.listEntries>0)ba=listTypeProperties.standardViewProperties.listEntries;else ba=25;K.kreports.standardview.store.pageSize=ba;}switch(aS){case 'None':case 'Asynchronous':aB="Displaying Records {0} - {1}";K.kreports.standardview.store.getProxy().extraParams.doCount=false;break;case 'Synchronous':aB="Displaying Records {0} - {1} of {2}";K.kreports.standardview.store.getProxy().extraParams.doCount=true;break;}if(document.getElementById('reportoptions').value!='')bI=Ext.JSON.decode(document.getElementById('reportoptions').value);else bI=new Object();if(bI.resultsFolded!=undefined&&bI.resultsFolded=='collapsed')resultsFolded=true;else resultsFolded=false;K.kreports.standardview.grid=new Ext.grid.Panel({id:'kReporterPresentation',store:K.kreports.standardview.store,selType:'rowmodel',columns:ColumnsArray,monitorResize:true,autoHeight:true,minHeight:400,boxMinHeight:250,renderPresentation:function(){this.render('reportGrid');var position=this.getPosition();this.setHeight(Math.max(Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),Math.max(document.body.offsetHeight,document.documentElement.offsetHeight),Math.max(document.body.clientHeight,document.documentElement.clientHeight))-100-position[1]);},reloadPresentation:function(whereConditions,snapshotid){K.kreports.standardview.store.removeAll();K.kreports.standardview.store.getProxy().extraParams.whereConditions=whereConditions;K.kreports.standardview.store.getProxy().extraParams.snapshotid=snapshotid;if(aS!='Synchronous'&&aS!='None'){K.kreports.standardview.store.whereConditions=whereConditions;K.kreports.standardview.store.reCount=true;}K.kreports.standardview.store.load({params:{start:0,limit:ba}});},bS:function(){bk=new Array();for(i=0;i<K.kreports.standardview.grid.columns.length;i++){bk[i]=new Object();bk[i].sequence=i+1;bk[i].dataIndex=K.kreports.standardview.grid.columns[i].dataIndex;bk[i].width=K.kreports.standardview.grid.columns[i].getWidth();bk[i].isHidden=K.kreports.standardview.grid.columns[i].isHidden();}return bk;},tools:[{type:'save',disabled:(accessLevel>0?true:false),handler:function(){Ext.Ajax.request({url:'index.php?module=KReports&to_pdf=true&action=save_standard_layout',params:{record:document.getElementById('recordid').value,layoutparams:Ext.JSON.encode(K.kreports.standardview.grid.bS())},success:function(){}});}}],bbar:new Ext.toolbar.Paging({store:K.kreports.standardview.store,displayInfo:true,displayMsg:aB}),title:bi('LBL_STANDARDGRIDPANELTITLE'),collapsible:true,collapsed:resultsFolded,listeners:{'viewready':function(){this.setHeight();}}});if(aS!='Synchronous'&&aS!='None')K.kreports.standardview.store.reCount=true;K.kreports.standardview.store.load({params:{start:0,limit:ba}});function bm(){Ext.Ajax.request({url:'index.php?module=KReports&action=load_report_count&to_pdf=true',success:function(result){Ext.getCmp('kReporterPresentation').setTitle(bi('LBL_STANDARDGRIDPANELTITLE')+' ('+result.responseText+' records found)');K.kreports.standardview.store.totalLength=80;},params:{requester:document.getElementById('recordid').value,whereConditions:K.kreports.standardview.store.whereConditions}});}