PDA

View Full Version : Extjs 4.2.1 grouping summary with drag drop not working



sayaliingavale
5 May 2014, 5:09 AM
Hi, I am using extjs 4.2.1. In my application I have used two grids with dragdrop plugin. One of the grid is grouping grid having summary feature. When I drag from other grid to summary grid, my application gets hang saying "Uncaught RangeError: Maximum call stack size exceeded". Cant we use grouping summary and drag drop together? Please reply ASAP if any solution.

Thanks in advance. :)

Gary Schlosberg
5 May 2014, 8:55 AM
They should work together. It sounds like this bug might be affecting things:
http://www.sencha.com/forum/showthread.php?262317

sayaliingavale
17 Jun 2014, 6:23 AM
Can you please provide working example for this issue? because I have tried following code that works well with extjs 4.1.1 but not 4.2.1 (except sums are not correct in both :()


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);
}
}
}
});