View Full Version : Expand treenode when mouseover for more than 1 sec

9 Jun 2010, 11:31 PM
Hi All,

I have a treepanel and a dataview. I am dragging item from dataview to treepanel. I want to expand a treenode only when I am dragging over that particular node for more than 1 second. Is there a simple way to implement that?


10 Jun 2010, 12:14 AM
Anyone? Animal?

10 Jun 2010, 12:30 AM
mouseover event with the buffer option

10 Jun 2010, 12:31 AM
Yuo need a bit more to be able to cancel the impending fire if the user mouses out, but that will start you off.

10 Jun 2010, 12:34 AM
What is the concept of buffer? It may possible to keep checking for particular milliseconds whether the node is same as the previous one or not.

10 Jun 2010, 12:57 AM
buffer is a "waiting time", you need this for timing correction. If you use it with an event, it reacts the buffer time later.

10 Jun 2010, 1:04 AM
Best would be to create an Ext.util.DelayedTask to expand the node. Obviously, only create one, at initialization time of your class, and use it from ten on.

Schedule it to run on mouseover, and cancel it on mouseout.

10 Jun 2010, 1:07 AM
Thanks Animal.

I had that idea but just did not know whether that would be the best or not.