Ext.ns('wt.grid'); wt.grid.AutoWidths = function(config) { Ext.apply(this, config); }; Ext.extend(wt.grid.AutoWidths, Ext.util.Observable, { init: function (cmp) { cmp.store.on('load', function(g){ var numCol = cmp.getColumnModel().getColumnCount(); for(var i=0;i'+value+''; } try{ pass = { sdate:"", edate:"", fields:"", sfields:"", network:"", units:"", missing:"", trace:"", time:"", gdd:"", frequency:"", stationname:"", station:"", qualified:"", unique_id:"", gdd_val:"", act:'table' }; stationInfo = {"station_id":"N\/A","station_name":"N\/A","latitude":"N\/A","longitude":"N\/A","elevation":"N\/A","state":"N\/A","country":"N\/A"}; fieldsCount = pass.sfields.split(',').length + pass.fields.split(',').length; dataStoreFields = []; for (var i=0;i
Please contact the administrator.'); } else { Ext.Msg.alert('System Error','Please contact the administrator.'); } } }, 'load' : function(store,rec,opt){ if (0==rec.length){ Ext.getCmp('reportGrid').loadMask.hide(); } } }, successProperty : 'success', precision:json.precision, baseParams:{ sdate:pass.sdate, fields:pass.fields, edate:pass.edate, act:pass.act, freq:pass.frequency, qualified:pass.qualified, unique_id:pass.unique_id, station:pass.station, sfields:pass.sfields, gdd:pass.gdd, units:pass.units, missing:pass.missing, trace:pass.trace, time:pass.time, limit:100 }, fields:dataStoreFields, totalProperty : 'totalCount' }); var reportGrid = new Ext.grid.GridPanel({ id : 'reportGrid', headings:json.headers, renderTo:'center', loadMask:true, title:'
Climate Reports | Quick View (Showing first 100 records)
', store : reportStore, layout:'fit', plugins:new wt.grid.AutoWidths(), viewConfig : { emptyText : 'No Data', deferEmptyText : false }, colModel: new Ext.grid.ColumnModel({ defaults: { width: 75, renderer:reportRender, sortable: true }, columns:json.columns }), height : 832, /*bbar : new Ext.PagingToolbar({ store : reportStore, pageSize : 100, id : 'pb_reportGrid', displayInfo : true, displayMsg : 'Results {0} - {1} of {2}', emptyText : 'Nothing to Display' }),*/ width:842 }); var childItems = []; var sfields =pass.sfields.split(','); var details1 = { cn:sfields[0].replace(/_/g,' ')+': '+ stationInfo[sfields[0].toLowerCase()] + '
' + sfields[2].replace(/_/g,' ')+': '+ stationInfo[sfields[2].toLowerCase()] + '
' + sfields[5].replace(/_/g,' ')+': '+ stationInfo[sfields[5].toLowerCase()] } var details2 = { cn:sfields[1].replace(/_/g,' ')+': '+ stationInfo[sfields[1].toLowerCase()] + '
' + sfields[3].replace(/_/g,' ')+': '+ stationInfo[sfields[3].toLowerCase()] + '
' + sfields[6].replace(/_/g,' ')+': '+ stationInfo[sfields[6].toLowerCase()] } var elevMetric = (parseInt(stationInfo[sfields[4].toLowerCase()])*0.3048).toFixed(1).toString(); // conversion to metric units var elevEnglish = (parseInt(stationInfo[sfields[4].toLowerCase()])).toFixed(1).toString(); // stays in English units var details3 = { cn:'
' + sfields[4].replace(/_/g,' ')+': '+ elevEnglish + ' ft' +'
' + elevMetric + ' m
' } // displays elevation details var details4 = { cn: 'Climate Reports | Quick View (Showing first 100 records)
' + '
Selected Period of Record: '+ pass.sdate + ' to ' + pass.edate + '*Note: The table view does not fill in missing dates.
' } Ext.DomHelper.overwrite(Ext.get('ob1'), details1); reportStore.load({ params:{start:0,limit:100} }); Ext.DomHelper.overwrite(Ext.get('ob2'), details2); Ext.DomHelper.overwrite(Ext.get('ob3'), details3); Ext.DomHelper.overwrite(Ext.get('title'), details4); }, function(response) {} ); // End ajaxRequest() var p = new Ext.Panel({ renderTo:'details', layout:'fit', width:842, title:'Station Details', id:'tester', plain:false, frame:true, //html:'

Loading Details...

', items:[{ xtype:'panel', layout:'column', items:[{ xtype:'panel', width:110, html:'
' },{ xtype:'panel', width:200, html:'
' },{ xtype:'panel', width:92, html:'
', }] }] }); var reportStore = Ext.StoreMgr.get('tableStore'); }catch(ex){console.log(ex)} });