View Full Version : grid to grouping grid drag n drop, remove item

16 Nov 2011, 9:09 AM

I made 2 grids, drop from first grid to second. Second grid is grouping grid. On the second group there is a property (multiple), if it is false, the group can contain only one element, so when a drop happened, I need to remove the other element from the group.

If I first time drop an item from first to second grid, then it is working. But the second time, it is not working, because, the index is copied too from the first grid.

this is the event:
drop: this.onDropToApproverArea,

This is the drop handler:

onDropToApproverArea: function(node, data, dropRec, dropPosition)

if (data.records[0].get('multiple')=='false')
var removeIndex=dropRec.index;
if (dropPosition=='before') { removeIndex++; } else { removeIndex--; }

How can I make this work, after the second drop event?


16 Nov 2011, 7:11 PM
if you have a reference to the dropped record ( dropRec), you can use dropRec.store.remove(dropRec)

17 Nov 2011, 4:49 AM
thank's, it is working!