PDA

View Full Version : Bug? in grid grouping with multiple fields



BoroChris
23 Mar 2012, 4:32 AM
My grid was all working fine until I had to group it by two fields.I did as suggested and created a new hidden field containing the data from both and grouped on that and all looks fine however the data cells seem to have moved over into the hidden column and there is a half-hidden header where the new grouped field is.Not sure if this is an Ext bug or something not right in my code.
Ext.define('gridpanelopstatsgrid9Model',{extend:'Ext.data.Model', fields:[{name:'Date'},{name:'Hospital'},{name:'HospitalDate'},{name:'Location'}, {name:'Expected'},{name:'CheckedIn'},{name:'lateDNA'},{name:'Due'},{name:'Kioskchin'},{name:'PerKiosk'},{name:'late'}]});var myData=Ext.create('Ext.data.Store', {model:'gridpanelopstatsgrid9Model',id:'myData', data:[{CheckedIn:102,Date:'22Mar2005',Due:6,Expected:113,Hospital:'CRH', HospitalDate:'22Mar2005 CRH',Kioskchin:53,Location:'Outpatient Main Reception',PerKiosk:52,lateDNA:5} ,groupField:'HospitalDate'});var gridpanelopstatsgrid9Cols=[{text:'Date',hideable:false,dataIndex:'Date',sortable:'True'}, {text:'Hospital',hideable:false,dataIndex:'Hospital',sortable:'True'}, {text:'HospitalDate',hidden:'True',hideable:true,dataIndex:'HospitalDate',sortable:'False',startCollapsed:true}, {text:'Location',hideable:false,dataIndex:'Location',sortable:'True'}, {text:'Expected',hideable:false,dataIndex:'Expected',sortable:'True',summaryType:'sum'}, {text:'Checked In',hideable:false,dataIndex:'CheckedIn',sortable:'True',summaryType:'sum'}, {text:'Late|DNA',hideable:false,dataIndex:'lateDNA',sortable:'True',summaryType:'sum'}, {text:'Due',hideable:false,dataIndex:'Due',sortable:'True',summaryType:'sum'}, {text:'Kiosk checked in',hideable:false,dataIndex:'Kioskchin',sortable:'True',summaryType:'sum'}, {text:'% Kiosk',hideable:false,dataIndex:'PerKiosk',sortable:'True'},{text:'late',hidden:'True',dataIndex:'late',sortable:'True'}];Ext.create("Ext.grid.Panel",{autoRender:true,columns:gridpanelopstatsgrid9Cols,frame:true,groupfield:"HospitalDate", height:650,id:"gridpanelopstatsgrid9",liveupdate:true,store:myData,summary:true,title:"Check in Status", viewConfig:"getRowClass: function (row, index) {return colourGrid(row, index)}", features:[{ftype:"groupingsummary",id:"itemopstatsgrid109"}]});33066

BoroChris
23 Mar 2012, 4:33 AM
Sorry guys not sure why code window so small. Wasn't like that on preview.

BoroChris
23 Mar 2012, 4:39 AM
Oh sugar, forget it. Spent hours trying to find out why and spotted it 2 minutes after posting.
hidden=True is wrong and seems to do weird things, hidden=true solves the problem.