PDA

View Full Version : [CLOSED] I want to reply example GroupingSummary



osef
May 13, 2015, 5:40 AM
Hi team, I want to reply the example from http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.grid.feature.GroupingSummary

in Ext.Net 2.2.xx, but I have a error in the last column to each group, because, I don't see the summary, this is my code:



<head>
<title></title>
<script type="text/javascript">
Ext.onReady(function () {
Ext.define('TestResult', {
extend: 'Ext.data.Model',
fields: ['student', 'subject', {
name: 'mark',
type: 'int'
}]
});

Ext.create('Ext.grid.Panel', {
width: 200,
height: 240,
renderTo: document.body,
features: [{
groupHeaderTpl: 'Subject: {name}',
ftype: 'groupingsummary'
}],
store: {
model: 'TestResult',
groupField: 'subject',
data: [{
student: 'Student 1',
subject: 'Math',
mark: 84
}, {
student: 'Student 1',
subject: 'Science',
mark: 72
}, {
student: 'Student 2',
subject: 'Math',
mark: 96
}, {
student: 'Student 2',
subject: 'Science',
mark: 68
}]
},
columns: [{
dataIndex: 'student',
text: 'Name',
summaryType: 'count',
summaryRenderer: function (value) {
return Ext.String.format('{0} student{1}', value, value !== 1 ? 's' : '');
}
}, {
dataIndex: 'mark',
text: 'Mark',
summaryType: 'average'
}]
});
});
</script>

</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="rmFormaAvances" runat="server" HideInDesign="true" />
</form>
</body>



This is the result

23976

I have two "Math" and two "Science" and I don't see the summary to "Math" group and "Science" group.

Thank you

Daniil
May 13, 2015, 8:33 AM
Hi @osef,

It works for me. Please clarify what Ext.NET version are you using?

Please try with the latest 2.5.3 release or with the sources from SVN.