Hi everyone,
I've a problem at drag & drop between two grids. I followed the sample on the examples page, but it doesn't work.
I'll be happy if someone helps me. By the way I don't take any errors on Firebug..
Thanx in advance..
With regards..
Code:
var secondGrid = new SmallPersonellerGrid({ title : 'Second Panel', height : 300,enableDragDrop:true,ddGroup : 'thirdGridDDGroup' });
var thirdGrid = new PersonelVekalet({ colspan : 2, ddGroup : 'secondGridDDGroup',enableDragDrop:true });
var blankRecord = new recordPersonelVekalet();
var thirdGridDropTarget;
var secondGridDropTarget;
var mainPanel = new Ext.Panel({
title : 'Main Panel',
iconCls : 'panel',
layout : 'table',
layoutConfig: {
columns : 2
},
items : [ gridPersoneller, secondGrid, thirdGrid ],
......, listeners : {
afterrender : function(comp) { // cuz of preventing scroller undefined error
var thirdGridDropTargetEl = thirdGrid.getView().scroller.dom;
thirdGridDropTarget = new Ext.dd.DropTarget(thirdGridDropTargetEl, {
ddGroup : 'thirdGridDDGroup',
notifyEnter : function(ddSource, e, data) {
//Add some flare to invite drop.
thirdGrid.body.stopFx();
thirdGrid.body.highlight();
},
notifyDrop : function(ddSource, e, data){
var records = ddSource.dragData.selections;
Ext.each(records, ddSource.grid.store.remove, ddSource.grid.store);
thirdGrid.store.add(records);
return true;
}
});
var secondGridDropTargetEl = secondGrid.getView().scroller.dom;
secondGridDropTarget = new Ext.dd.DropTarget(secondGridDropTargetEl, {
ddGroup : 'secondGridDDGroup',
notifyEnter : function(ddSource, e, data) {
//Add some flare to invite drop.
secondGrid.body.stopFx();
secondGrid.body.highlight();
},
notifyDrop : function(ddSource, e, data){
var records = ddSource.dragData.selections;
Ext.each(records, ddSource.grid.store.remove, ddSource.grid.store);
secondGrid.store.add(records);
return true;
}
});
}
}
});