PDA

View Full Version : [DEFER] Grid Drag and Drop does not work with summary row feature



mikhailt
8 Nov 2011, 3:47 AM
REQUIRED INFORMATION


Ext version tested:
Ext 4.0 rev7

Browser versions tested against:
IE9 FF7 Safari 4 all browsers

DOCTYPE tested against:
any

Description:
Drag to a grid does not work when grouping with summary row is enabled.

Steps to reproduce the problem:
Drag a row from one grid to another, with a summary row. Drop will not work.

The result that was expected:
Drag and drop must work with summary row as well as without it.

The result that occurs instead:
The row can not be dropped to a grid with grouping and summary.

Test Case:




Ext.require([
'Ext.grid.*',
'Ext.data.*',
'Ext.dd.*'
]);

Ext.define('DataObject', {
extend: 'Ext.data.Model',
fields: ['name', 'column1', 'column2']
});

Ext.onReady(function(){

var myData = [
{ name : "Rec 0", column1 : "0", column2 : "0" },
{ name : "Rec 1", column1 : "0", column2 : "1" },
{ name : "Rec 2", column1 : "0", column2 : "2" },
{ name : "Rec 3", column1 : "0", column2 : "2" },
{ name : "Rec 4", column1 : "1", column2 : "3" },
{ name : "Rec 5", column1 : "1", column2 : "3" },
{ name : "Rec 6", column1 : "1", column2 : "3" },
{ name : "Rec 7", column1 : "1", column2 : "4" },
{ name : "Rec 8", column1 : "2", column2 : "4" },
{ name : "Rec 9", column1 : "3", column2 : "0" }
];

// create the data store
var firstGridStore = Ext.create('Ext.data.Store', {
model: 'DataObject',
data: myData
});


// Column Model shortcut array
var columns = [
{text: "Record Name", flex: 1, sortable: true, dataIndex: 'name'},
{text: "column1", width: 70, sortable: true, dataIndex: 'column1', summaryType: 'count'},
{text: "column2", width: 70, sortable: true, dataIndex: 'column2', summaryType: 'count'}
];

// declare the source Grid
var firstGrid = Ext.create('Ext.grid.Panel', {
multiSelect: true,
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
ddGroup: 'gridDDGroup',
enableDrop: false
}
},
store : firstGridStore,
columns : columns,
stripeRows : true,
title : 'First Grid',
margins : '0 2 0 0'
});

var secondGridStore = Ext.create('Ext.data.Store', {
model: 'DataObject',
groupField: 'column1',
});

// create the destination Grid
var secondGrid = Ext.create('Ext.grid.Panel', {
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
ddGroup: 'gridDDGroup',
enableDrag: false
}
},
features: [{
ftype: 'groupingsummary',
groupHeaderTpl: '{name}'
}],
groupField: 'column1',
store : secondGridStore,
columns : columns,
stripeRows : true,
title : 'Second Grid',
margins : '0 0 0 3'
});

//Simple 'border layout' panel to house both grids
var displayPanel = Ext.create('Ext.Panel', {
width : 650,
height : 300,
layout : {
type: 'hbox',
align: 'stretch',
padding: 5
},
defaults : { flex : 1 }, //auto stretch
items : [
firstGrid,
secondGrid
]
});

displayPanel.render(document.body);
});






HELPFUL INFORMATION


Screenshot or Video:
attached29120

Operating System:
Windows 7

mitchellsimoens
17 Nov 2011, 1:57 PM
Looks like it works if you drop it into the correct group. I'm gonna defer this because we are making some changes that affect sorting and filtering that came about when adding a record to the store so that fix may fix it.

vadimv
30 Mar 2012, 4:42 AM
any news on this, I'm using 4.1 RC and it works , but not how supposed to, sometimes the total row is not updated when a row is dropped in grid, looking for a forcing update method to call it in the drop listener