PDA

View Full Version : Ext.grid.plugin.DragDrop | Grid is not scrolling



ksandeepa
2 Apr 2013, 10:06 PM
Hi,
I have used Ext.grid.plugin.DragDrop to enable drag and drop feature. When we have lots of items in the grid the scroll bar appears, this is fine. The problem is when we try to drag the item which is at the end to top the grid does not scroll automatically. I will have to do this in the steps - drag item and place it in the currently visible list and the scroll the grid and drag the item again.
My code is similar to this,


Ext.onReady(function () {
Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
fields: ['name'],
data: [
["Lisa"],
["Bart"],
["Homer"],
["Marge"],
["Lisa"],
["Bart"],
["Homer"],
["Marge"],
["Lisa"],
["Bart"],
["Homer"],
["Marge"]
],
proxy: {
type: 'memory',
reader: 'array'
}
});


Ext.create('Ext.grid.Panel', {
store: 'simpsonsStore',
columns: [{
header: 'Name',
dataIndex: 'name',
flex: true
}],
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
dragText: 'Drag and drop to reorganize'
}
},
height: 200,
width: 400,
renderTo: Ext.getBody()
});
});

slemmon
4 Apr 2013, 11:55 AM
Set containerScroll (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.grid.plugin.DragDrop-cfg-containerScroll) to true in your Ext.grid.plugin.DragDrop (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.grid.plugin.DragDrop) config object.



viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
dragText: 'Drag and drop to reorganize',
containerScroll: true
}
}