Friday, March 30, 2012

Re: CustomScrollPanel issue (extra div overlays generated impacting performance?)

Hi Thomas,

Thanks so much for all of your suggestions and for explaining the extra DIVs, it makes a lot more sense now. I'll try what you said and let you know. Thanks again.

-Seth

On Friday, March 30, 2012 5:40:47 AM UTC-4, Thomas Broyer wrote:


On Thursday, March 29, 2012 5:43:55 AM UTC+2, GWTter wrote:
Hi all,

I've used the CustomScrollPanel in order to implement some custom scrollbars, everything was working great until I added DnD (gwt-dnd, not native) functionality
to an element in the scrollpanel. The dragging action on the elements within is extremely laggy. After a good amount of testing I found that the issue had to do with
the CustomScrollPanel since using a regular ScrollPanel performs just fine with minimal lag if any. I then looked at what is generated for the customscrollpanel to
work and found some divs had been generated which I couldn't attribute any specific functionality to (ITEMs 1 & 2 below). They're basically just overlaying the whole
scrollpanel area and deleting them with firebug did not affect the customscrollpanel functionality, but deleting them did improve the dnd performance considerably. I see that
the more elements that are layered between the mouse click and the target element affect the performance to a good degree.

My question is does anyone know if these extra DIVs are needed, and if so is there a way to workaround so I can still have the custom scroll bars with good DnD.

The DIVs are added by the ResizeLayoutPanel.ImplStandard to detect when the content grows or shrinks, so the CustomScrollPanel can update the scrollbars.

BTW, the ITEM3 div is used by the Layout to detect changes of the font size so ti can update its layers when they're positioned using EM or EX units.

Does changing the z-index of the various divs (ITEM1, ITEM2 and dragdrop-dropTarget) changes anything performance-wise?

DIRTY HACK: You could also try calling onDetach() on the containerResizeImpl when entering the scroll panel (while dragging) and calling onAttach() when leaving or dropping (use JSNI to access the private containerResizeImpl). You might have to explicitly call maybeUpdateScrollbars() after calling containerResizeImpl.onAttach(), as I'm not sure onAttach() would call the ResizeLayoutPanel.Impl.Delegate), and you might have to call it from a Scheduler.get().scheduleDeferred(), as ResizeLayoutPanel.ImplStandard uses it.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/rs-N4h0_ED4J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment