I am using extjs 4.2.1. I have a grid with dragdrop
plugin. I have added grouping summary feature. Drag drop stopped working after adding grouping feature (saying "Maximum call stack size exceeded ext-all-debug.js:16941").
I have tried on fiddle. Following code works with extjs 4.1.1
but not in 4.2.1
.
Following is the code:
Ext.define('TestResult', {
extend: 'Ext.data.Model',
fields: ['student', 'subject', {
name: 'mark',
type: 'int'
}]
});
Ext.create('Ext.grid.Panel', {
width: 400,
height: 440,
renderTo: document.body,
features: [{
groupHeaderTpl: new Ext.XTemplate('<tpl for=".">', '<input type="button" value={name}></div>', '</tpl>'),
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: 'sum'
}],
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop'
}
},
listeners: {
afterrender: function(grid, eOpts) {
// Getting summary here
console.log('Sum >> ', grid.store.sum('mark', true));
},
groupclick: function(view, node, group, e, eOpts) {
console.log('Clicked on ', group);
if (e.getTarget().type === 'button'){
alert('Clicked on '+ group);
}
}
}
});