PDA

View Full Version : Drag and Drop between 2 grids (revisited)



ericd
28 Jul 2007, 7:27 AM
All,

I know this subject was visited and revisited over and over, but I am looking for something particular and have not found anything related. I must have looked at every thread and studied Firebug output until my eyes popped out of their sockets so I will ask.

I have 2 grids that have drag and drop enabled. Grid 1 is drop only, grid 2 is drag only. I can drag row(s) from grid 2 to grid 1 that works (thanks to all the threads I read) but what I am unable to get is on which row index of grid 1 is the data getting dropped. Getting the row(s) from grid 2 is easy but I find nothing similar for Grid 1.

Any suggestions would be appreciated
Eric

evant
28 Jul 2007, 4:59 PM
Care to post your code, or set up an example page somewhere?

galdaka
1 Aug 2007, 7:09 AM
http://extjs.com/forum/showthread.php?t=9625&highlight=galdaka

Animal
1 Aug 2007, 7:28 AM
It's very similar to DnD between two Views.

Each needs either a DragZone or a DropZone.

See this example of a DDView I posted: http://extjs.com/forum/showthread.php?t=9629

I've extended it so that double click on a draggable View, checks if there is only one other doppable View and performs the drag/drop if it does.

vtswingkid
2 Aug 2007, 4:44 AM
I created a select form item that uses two grids.
Anyway, if the preserveOrder config option is set to true.
The index of the drop target is used. Have a look at the code.

http://extjs.com/forum/showthread.php?t=9390