PDA

View Full Version : Grid drag and drop plugin problem



Steve88
6 Mar 2012, 4:04 AM
Hi all!I have 9 grids, 1 used for drag items, the other 8 used to drop that items.I have a problem with the grid plugin.When i drag a element into one grid, this element it's repeated into the others grid:

When i take the element:

32410





When i drop the element into one grid:



32411





//Grid with the items i need to drag
var GridListaBanner = Ext.create('Ext.grid.GridPanel',
{
store: StoreGridListaBanner,
id: 'gridListaBanner',
columns:
[{
dataIndex: 'id',
hidden: true
},
{
dataIndex: 'bannersrc',
width: 90
},
{
text: 'Titolo',
dataIndex: 'linktitle',
flex: 1
}],
viewConfig: {
copy: true,
plugins: {
ptype: 'gridviewdragdrop',
dragText: '  Posiziona il banner in una delle grid',
dragGroup: 'gridListaBanner',
dropGroup: 'Banner1',
dropGroup: 'Banner2',
dropGroup: 'Banner3',
dropGroup: 'Banner4',
dropGroup: 'Banner5',
dropGroup: 'Banner6',
dropGroup: 'Banner7',
dropGroup: 'Banner8'
}
}
});




//Example of grid used to contains the dropped item
var GridBanner1 = Ext.create('Ext.grid.GridPanel',
{
flex: 1,
id: 'Banner1',
name: 'Banner1',
columns:
[{
dataIndex: 'immagine',
width: 60
},
{
text: 'Da',
dataIndex: 'id',
flex: 1
},
{
text: 'A',
dataIndex: 'a',
flex: 1
},
{
text: 'Peso',
dataIndex: 'peso',
flex: 2
},
{
text: 'Attivo',
dataIndex: 'enable',
flex: 1
}],
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
dragGroup: 'Banner1',
dropGroup: 'gridListaBanner',
enableDrag: false,
}
}
});


what is wrong?Thank you :)

tvanzoelen
6 Mar 2012, 5:05 AM
Do the grids share the same store?

Steve88
6 Mar 2012, 5:18 AM
Do the grids share the same store?
No only GridListaBanner use the store, the others grid not use store because i need to fill them with the drag and drop of the items :)

Steve88
6 Mar 2012, 5:23 AM
Ok i have resolved the problem!

i have insert "store: []" into the others grid and now all work perfectly! :D

Thank you tvanzoelen :)