I have a WebDataTree in which nodes may be dragged and dropped. If the tree is sufficiently tall, the page has scrollbars. This is fine.
But when I drag off the bottom or top of the page, the page does not scroll with my dragging to allow me to drag to an area that has scrolled off the page.
Is there any way to make the page scroll as desired when dragging?
Thanks!
Hi Makuch,
Thanks for posting your solution! I'm glad to hear you were able to get it working across browsers.
If you have any further questions with this, please let me know.
OK, I got it. I used jQuery and that made the cross browser thing a bit easier.
I scrolls both up and down and works on IE 9 and FireFox.Here is my DragMove function, sorry about the poor formatting:
function dragMove(sender, args) {
var distanceToEdge = 30;
var scrollSpeed = 5;
var y = args.get_y();
var windowHeight = $(window).height();
var scrollTop = $(window).scrollTop();
if (y > (windowHeight + scrollTop) - distanceToEdge) {
scrollBy(0, scrollSpeed);
} else if (y < (scrollTop + distanceToEdge)) {
scrollBy(0, -scrollSpeed); }
}
This seems to work in Firefox, but not IE.
Also need to get it working for dragging up as well as down, but I think I can handle that.
Hi jmakuch,
I've found a way to scroll the screen while dragging nodes by handling the client side DragMove event of the WebDataTree.
You can use the following code in the DragMove handler:
Please let me know if you need further assistance with this and I'll be glad to help you.
Dear jmakuch,
Thank you for contacting Infragistics!
We have received your support request concerning the page not scrolling while dragging nodes, and this case has been assigned to me. Infragistics is dedicated to helping you solve this issue. Our team and I have done an initial review of your case and I am looking into what options are available to scroll the page while dragging nodes.
I will get back to you by the end of the tomorrow with more information or questions for you. If you have any questions or concerns with this, please let me know.
Looking forward to hearing from you.