PDA

View Full Version : LiveGrid Drag And Drop Scrolling



mdomingo
1 Apr 2011, 5:20 AM
Good day,

I am currently working on an issue I could use some help with. We currently have a livegrid in which we have implemented drag/drop support to reorder items in the list. The reordering seems to be working fine, however the only issue we seem to be having is that the grid will not scroll if you drag near the top or bottom of the grid. At first it wouldn't scroll at all, until I overrode the getScroller() method of the LiveGridView class to return the liveScroller rather than the GridView's scroller. Now it will scroll if you drag the item you are attempting to reorder and hover it over the up or down scroll arrow. I'm assuming I'm having the same problem with the grid using the wrong scroller but I'm not sure where to look. Any suggestions you could provide would be appreciated.

Thanks!
Max

Ersmarker
7 Apr 2011, 10:51 PM
In the LiveGrid the scroller is a in a separate div from the "normal" grid.
You can check this in FireBug be selecting the scrollbar in the LiveGrid. Then you see thats it's a 0px wide div, with the height of the entire grid. Compare that to the normal grid where the scrollbar is a part of the div containing the rows

The scroll support fails in the LiveGrid because it tries to scroll scroller element, but since it does not have a scrollbar is can't scroll.
With your modification getting the liveScroller it works when you move the mouse over the liveScroller div, but it's not detecting when you are at the bottom/top over the div containing the rows.

You need to extend ScrollSupport to check both the normal scroller and liveScroller.

I hope this answer make sense. :)