PDA

View Full Version : ExtJs - Grid Summary Row displays the values of first row



rvelagaleti@hanover.com
21 Feb 2013, 11:32 AM
I have used the "summary" feature in my grid and the summaryType is "sum". But every time I load the grid, it only displays the values from the first row, even if there are multiple rows.The store is populated in the controller.Here is the screenshot. Any idea on what's happening? I can give the code snippet, but it's just a normal grid with feature as summary and the specific columns have "summaryType" as 'sum'. Please let me know if any additional details are required.

41984

scottmartin
21 Feb 2013, 12:30 PM
It should work if setup correctly:
http://jsfiddle.net/RMfzF/1/

Scott.

rvelagaleti@hanover.com
21 Feb 2013, 1:11 PM
This is the code for my grid:


{ xtype : 'grid',
itemId : 'medicalBillPaymentsGrid',
cls : 'huw-grid',
store : paymentDetailStore,
padding : 10,
border : false,
features : [ {
ftype : 'summary'
} ],
plugins : [ rowEditing ],
columns : [
{
header : 'SVC Beg. Dt',
dataIndex : 'medSvcBegDt',
flex : 1,
renderer : Ext.util.Format
.dateRenderer('m-d-Y'),
summaryType : 'count',
summaryRenderer : function(
value,
summaryData,
dataIndex) {
return Ext.String
.format('Totals');
}
},
{
header : 'SVC End. Dt',
dataIndex : 'medSvcEndDt',
flex : 1,
renderer : Ext.util.Format
.dateRenderer('m-d-Y')
},
{
header : 'Rev Cd',
dataIndex : 'medSvcClmCd',
flex : 1
},
{
header : 'Unt/Dys',
dataIndex : 'medHospUnitDy',
flex : 1
},
{
header : 'Exclusion Amount',
dataIndex : 'medSvcExclAmt',
flex : 1,
summaryType : 'sum'
},
{
header : 'Remark Codes',
dataIndex : 'medSvcDiagCd1',
flex : 1,
},
{
header : 'Charges',
dataIndex : 'medSvcSubmChrgAmt',
flex : 1,
summaryType : 'sum'
},
{
header : 'Excess Amt',
dataIndex : 'medSvcExcesAmt',
flex : 1,
summaryType : 'sum'
},
{
header : 'PPO',
dataIndex : 'medSvcPpoIndc',
flex : 1
},
{
header : 'Benefit Amount',
flex : 1,
dataIndex : 'medSvcBenAmt',
summaryType : 'sum'
} ]
}




The store?
paymentDetailStore
is updated in the controller after retrieving records from a different store.
Could there be an issue with the way store is getting populated with the records?