PDA

View Full Version : Gridview - drag and drop row onto another row



kncisko
22 May 2014, 6:29 AM
I have several tree panels and several grids in my application. Tree nodes are draggable and can be dropped onto one of the grids. This is accomplished by using treeviewdragdrop and gridviewdragdrop plugins for trees and grids respectively:

Tree:


...

viewConfig: {
plugins: {
ptype: 'treeviewdragdrop',
dragGroup: 'gridDDGroup'
},
...

Grid:


...
viewConfig: {
plugins: [
ptype: 'gridviewdragdrop',
ddGroup: 'gridDDGroup'
],
...

This works great. I'm able to drag and drop nodes from a tree to a grid, from one grid to another, and also within the same grid for reordering. However, there is one last task that i have to do, and that is to enable the tree nodes (and grid rows as well) to be dropped onto another grid row. For example, in one of the trees i have nodes with years (2008, 2009, 2010, etc.). First I drop the year 2008 node onto a grid, and then I would like to be able to drop node with the year 2012 onto 2008 row, and then catch the drop event of a grid row to get all the years in the 2008 - 2012 range. I'm not able to do that because i can't figure out how to make grid row to become a drop target.

Is that even possible with these two plugins? And if so, could you pls provide a small example how to acomplish that?

Thanks!