DragDrop performances

4 views
Skip to first unread message

MattiaLocatelli

unread,
Oct 28, 2009, 9:36:12 AM10/28/09
to Prototype & script.aculo.us
Hi all,
I'm experiencing a performance problem with drag and drop.

I drag an image on an html table.
I have only one draggable element (the image) and the problem is that
until the table is not big in size (let's say 7 columns and 30 rows)
the drag effect is very smooth, but when the size of the table is
bigger the performance of the drag operation is very rough.
I'm testing it in IE8.
Any idea is welcome.

Thanks in advance,
Mattia

Peter De Berdt

unread,
Oct 28, 2009, 9:42:03 AM10/28/09
to prototype-s...@googlegroups.com
You're quite vague, but I'm suspecting you have a droppable on every table cell. What you'll need to do, is make the table itself a droppable (only one) and the use the drop coordinates to find out on what cell the draggable was dropped.


Best regards


Peter De Berdt


Mattia Locatelli

unread,
Oct 28, 2009, 9:57:25 AM10/28/09
to prototype-s...@googlegroups.com
Hi,
I don't have any droppable on the table or anywhere in the page. There is just one draggable element and no droppables. Like in the online sample.
The code to create the draggable element is this :
 
var draggable = new Draggable(objId, { scroll: window });
 
Well, I think I found something:
I develop with IE8 and when I use the compatibility mode for IE7 the drag drop work pretty well. But if I use the IE8 engine is really bad.

Maybe is a problem with the IE8 engine...
 
2009/10/28 Peter De Berdt <peter.d...@pandora.be>

Mattia Locatelli

unread,
Oct 28, 2009, 11:50:00 AM10/28/09
to prototype-s...@googlegroups.com
Hi all,
I look with the IE8 profiler and I see the updateDrag function in IE8 takes in my page 456ms and in the IE7 compatibility mode 15 ms.
I think there is soem problems with the recursive execution of this function.
 
Thanks,
Mattia

2009/10/28 Mattia Locatelli <mattia.lo...@gmail.com>

Mattia Locatelli

unread,
Oct 29, 2009, 5:29:33 AM10/29/09
to prototype-s...@googlegroups.com
Hi all,
I make some tests, and I see the performance problem I have happen when the table is bigger than the window and so I have the scrollbars (I set the option scroll: window on my draggable but also without i have the same performance issue).
I see the prepare function takes a lot fo time to run, I suppose the bottleneck is getting the coordinates from the browser.
 
If anyone have any idea on how to solve this problem please post...
 
Thanks in advance

david

unread,
Oct 30, 2009, 5:25:33 AM10/30/09
to Prototype & script.aculo.us
Hi Mattia,

it seems that you can't do what you're actually doing, prototype could
not be able to correct IE lack of speed.
But what do you want to do exactly ?
So that we could (if we find something of course) give you some other
idea ;))

--
david


On 29 oct, 10:29, Mattia Locatelli <mattia.locatelli...@gmail.com>
wrote:
> Hi all,
> I make some tests, and I see the performance problem I have happen when the
> table is bigger than the window and so I have the scrollbars (I set the
> option scroll: window on my draggable but also without i have the same
> performance issue).
> I see the prepare function takes a lot fo time to run, I suppose the
> bottleneck is getting the coordinates from the browser.
>
> If anyone have any idea on how to solve this problem please post...
>
> Thanks in advance
> Mattia
>
> 2009/10/28 Mattia Locatelli <mattia.locatelli...@gmail.com>
>
> > Hi all,
> > I look with the IE8 profiler and I see the updateDrag function in IE8 takes
> > in my page 456ms and in the IE7 compatibility mode 15 ms.
> > I think there is soem problems with the recursive execution of this
> > function.
>
> > Thanks,
> > Mattia
>
> > 2009/10/28 Mattia Locatelli <mattia.locatelli...@gmail.com>
>
> >  Hi,
> >> I don't have any droppable on the table or anywhere in the page. There is
> >> just one draggable element and no droppables. Like in the online sample.
> >> The code to create the draggable element is this :
>
> >> var draggable = new Draggable(objId, { scroll: window });
>
> >> Well, I think I found something:
> >> I develop with IE8 and when I use the compatibility mode for IE7 the drag
> >> drop work pretty well. But if I use the IE8 engine is really bad.
>
> >> Maybe is a problem with the IE8 engine...
>
> >> 2009/10/28 Peter De Berdt <peter.de.be...@pandora.be>
Reply all
Reply to author
Forward
0 new messages