All right, I''ve figured out that this problem is caused by incorrect
scroll offset.
When dragged, there''s an incorrect offset between the pointer and the
actual "drop" position. So therefore when I am dragging something when
the scroll bar is at the bottom position, the scroll offset did not
plus with the scroll distance. Thus whenever I dropped, it''s actually
dropped at the very top of the entire tree.
Anything fix for this?
On Sep 2, 12:09 am, meng
<mac.sh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hello everyone:
>
> I''ve been using scriptaculous for very long time and it''s
really good.
> However, I just came across another problem about using sortables in a
> scrollable div.
>
> The basic structure is:
>
> <div style="overflow:auto; height=400px">
> <div id=''Item1''></div>
> <div id=''Item2''></div>
> .... divs here can be dragged and sorted.
> </div>
>
> It worked initially. As the items exceeds the height of the mother
> div, scroll bars appear. And by dragging items to the edge, the div
> can be scrolled as it should be.
>
> However, items won''t be sorted. For example if I drag item 25 back
> back to somewhere above item 23, there won''t be a gap as it should
be.
> And if I release my mouse, the item 25 will fly over to the top.
>
> After trying several times, I figured out that all the items that are
> initially within the first visible area (the top 400px), everything
> can be dragged and sorted normally. All the items that are invisible
> initially (need to scroll to show them), can not be sorted (no gap
> will be created among them, and no matter which on you dragged, it
> will fly up to the top when releasing your mouse).
>
> And, all the nested sortables beneath the first visible 400px can be
> dragged, however can not be sorted with the same reason (no gap is
> created among the sortables).
>
> Is there anyone has this same problem?
> Thank you so much!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---