PDA

View Full Version : Add summary row for the Selection type grid



4 Feb 2013, 6:23 AM
Hi,
I am having a grid of selection model. I would like to add summary row for the grid.
Because of the check boxes the summary of a column is showing to the preceding column.
Can any one please help me to add summary row to the selection model grid.

Bellow is my code of the grid panel.



Ext.define('tz.ui.TimesheetGridPanel', {
extend: 'Ext.grid.Panel',
frame:true,
anchor:'98%',
height:550,

features:[{
ftype:'summary'
}],

initComponent: function() {
var me = this;

me.teSearchPanel = new tz.ui.TESearchPanel({manager:me});
me.timeGridPanel = new tz.ui.TimeGridPanel({manager:me});

me.store = ds.tneSummaryStore;
me.store.guaranteeRange(0, 199);
me.selModel = Ext.create('Ext.selection.CheckboxModel');
me.columns = [ {
header : 'Start Date',
dataIndex : 'startDate',
renderer: Ext.util.Format.dateRenderer('m/d/Y'),
sortable : false,
width : 75
}, {
header : 'End Date',
dataIndex : 'endDate',
renderer: Ext.util.Format.dateRenderer('m/d/Y'),
sortable : false,
width : 75
}, {
header : 'Billable Hours',
dataIndex : 'billableHours',
sortable : false,
align : 'right',
renderer : function(value, metaData, record, rowIdx, colIdx, store, view) {
return value + ' hours';
},
field : {
xtype : 'numberfield'
},
width : 75
}, {
header : 'Billable Expense',
dataIndex : 'expenseAmount',
align : 'right',
renderer : Ext.util.Format.usMoney,
field : {
xtype : 'numberfield'
},
sortable : false,
width : 100,
summaryType:'sum',
summaryRenderer: function(value){
return Ext.util.Format.usMoney(value);
}
},{
header : 'Earned Amount',
dataIndex : 'earnedAmount',
align : 'right',
renderer : Ext.util.Format.usMoney,
sortable : false,
width : 100,
summaryType:'sum',
summaryRenderer: function(value){
return Ext.util.Format.usMoney(value);
}
}]


me.viewConfig = {
stripeRows: true,
};






me.callParent(arguments);
}


});











And i am attaching the snap shot of the grid .



41659



Thanks.

mitchellsimoens
6 Feb 2013, 2:55 PM
Sounds like a bug, what Ext JS 4.x.x version are you using?

6 Feb 2013, 8:45 PM
I'm using Ext JS version 4.0.0

13 Feb 2013, 3:07 AM
This is not resolved.
Can any one please help me.....