PDA

View Full Version : Auto Scroll On Drag Not Scrolling



neags23
27 Jan 2010, 7:57 AM
The auto scroll for DnD doesn't seem to be working. It doesn't even work in the examples for me. This example: http://www.extjs.com/deploy/dev/examples/tree/reorder.html says to scroll along the edge of the tree for autoscrolling... but this doesn't seem to work.

In fact, none of the examples with auto scrolling seem to work, except for this one: http://www.extjs.com/deploy/dev/examples/dd/field-to-grid-dd.html .

In my project, I have a tree with DnD enabled. I've set autoScroll: true, I've set containerScroll: true, but nothing seems to work.

I'm wondering if there's some Ext 3.1 bug that has caused autoscroll on DnD to stop working? I'm guessing it's not my code if the examples no longer work, either.

Anyone have any idea?

mitchellsimoens
27 Jan 2010, 8:41 AM
If you are talking about the autoScroll config option in say the TreePanel (http://www.extjs.com/deploy/dev/docs/?class=Ext.tree.TreePanel), this isn't used for DD scrolling. This just tells the browser to show scroll bars automatically or to clip anything outside.

What you need is the containerScroll in the TreeDragZone (http://www.extjs.com/deploy/dev/docs/?class=Ext.tree.TreeDragZone). This registers it with the DD ScrollManager (http://www.extjs.com/deploy/dev/docs/?class=Ext.dd.ScrollManager)

neags23
27 Jan 2010, 10:51 AM
I've set the containerScroll in the DragZone to true. It doesn't seem to do anything.

Are the current scrolling examples I linked in the OP working for anyone else?

27 Jan 2010, 2:12 PM
Works for me: http://tdg-i.com/img/screencasts/2010-01-27_1711.swf

neags23
27 Jan 2010, 2:14 PM
Works for me: http://tdg-i.com/img/screencasts/2010-01-27_1711.swf

Yes, that is the only one that works. I said:


In fact, none of the examples with auto scrolling seem to work, except for this one: http://www.extjs.com/deploy/dev/exam...o-grid-dd.html (http://www.extjs.com/forum/../deploy/dev/examples/dd/field-to-grid-dd.html) .

And that one does. But the tree example, for instance, does not. Try out that one.

mitchellsimoens
27 Jan 2010, 3:10 PM
So basically the grid versions of this work but the tree ones do not. Sum it up there?

neags23
27 Jan 2010, 6:36 PM
So basically the grid versions of this work but the tree ones do not. Sum it up there?

Yes. Thanks for putting it better than I did.

Thankfully, I think I found the fix. For my project, anyway.

In the Ext.tree.TreePanel in the initEvents function, the following code doesn't work:



if(this.containerScroll){
Ext.dd.ScrollManager.register(this.body);
}


This would scroll the entire tree body. By changing


this.body

to


this.innerBody

the problem is fixed. The scrolling works. The scrolling is a little choppy. It's not as smooth as in the grids. But it does work.

Anyone know what's up with that?

PTG
28 Feb 2010, 9:35 AM
Works for me too, thanks for the fix.