Answered: Scrolling Grid Automatically When Dragging An Element
I have my grid, which is 25 columns by 100 rows. I have built functionality where you can render a chart based on the cell selected in the grid.
The chart is rendered and placed inside the Grid View, so that when the grid is scrolled manually, the chart stays in the correct place.
What I need to be able to do, is when I am dragging a chart around (using Ext.dd.DD) which is rendered inside a normal element. I want it to scroll the grid when I reach the edge of the viewport.
However I have tryed figuring out the elements position, and scrolling accordingly (scrollTo and scrollByDeltaX/Y) but this is very unreliable and jolty. If you try to drag something, the mouse must be moving in order for the scroll to happen, but if you carry on moving the mouse and you reach the edge of the viewport, its just going to get stuck and you have to do some weird mouse wiggle to get it moving again.
I have also tryed using Ext.dd.ScrollManager, registering my element and hoping that it handles scrolling for me. But this also didnt work.
Finally I tryed looping the scroll method on a timer event, so that is kept trying to scroll every 0.25 secs while the dragged container was inside the threshold. This also didnt work.
All I want is that if I drag my chart container to the end of the viewport, it will carry on scrolling until I pull it away, not only move when I have moved the mouse inside the threshold.
In desperate need for assistance, anyone have any ideas?
I have found that the reason it does not scroll when I drag the element down is because the scrollbars are not actually attached to the grid, they are seperate (ext.grid.scroller).
I made a test app which I added a grid to the document body, the scroll bars that were rendered were the browsers not the grids, therefore when i dragged an element down, the browser controlled the dragging and scrolling correctly.
However, ExtJS doesnt seem to give any real support to automatic drag scrolling. Is there anyway around this?