How to detect cell of drop in Grid

Hello,

we have a grid where we can drop new items in it.
Actually we wish to sort the components as they are dropped on the grid, but only based on rows.

Is there a way to detect the cell/row where a drop has occured ? (Beside setting all grid cells as drop targets ?)

André

Hi!

Do you mean Table or GridLayout component with DragAndDropWrapper(s) ?

cheers,
matti

GridLayout (So that I can order the newly dropped components accordingly in the database)

Hi!

I’d put a DragAndDropWrapper to each cell in the GridLayout. It should be quite straightforward then.

If the DragAndDrop wrapper would tell on which component the drag ended, I think you could do this with only one DragAndDrop wrapper. It might be a useful feature in other cases too. Would you fill a ticket for it?

cheers,
matti

Yes, that’s possible, but does increase the DOM size by adding additional div’s.
This leads to poor performance as the grid grows.

http://dev.vaadin.com/ticket/515

Thanks