Opened 14 years ago

Closed 10 years ago

#4300 closed defect (wontfix)

Tree: dijit._TreeNode does not call "_afterExpand" and "_afterCollapse" methods

Reported by: guest Owned by:
Priority: high Milestone: future
Component: Dijit Version: 0.9
Keywords: Cc: [email protected]
Blocked By: Blocking:

Description (last modified by bill)

The problem is here:

setChildren: function(items){
		var ret = dijit.Tree.superclass.setChildren.apply(this, arguments);

		// create animations for showing/hiding the children
		this._wipeIn = dojo.fx.wipeIn({node: this.containerNode, duration: 250});
		dojo.connect(this.wipeIn, "onEnd", dojo.hitch(this, "_afterExpand"));
		this._wipeOut = dojo.fx.wipeOut({node: this.containerNode, duration: 250});
		dojo.connect(this.wipeOut, "onEnd", dojo.hitch(this, "_afterCollapse"));

		return ret;

First we create this._wipeIn and this._wipeOut animations, and then we connect this.wipeIn and this.wipeOut (without underscore) animations to _afterExpand and _afterCollapse methods, so they're not working.

Regards Pablo García

Change History (5)

comment:1 Changed 14 years ago by bill

Resolution: fixed
Status: newclosed

Ah good point. I'm not sure why those functions were even there, so I just removed them (and the connect calls) in [10380]

comment:2 Changed 13 years ago by Matt Sgarlata

Resolution: fixed
Status: closedreopened

The purpose of these methods is so that a user can connect to _afterExpand and _afterCollapse and trigger actions when an animation completes. Without these callbacks it's impossible to trigger actions that need to wait until after the tree is expanded or collapsed without significant modifications to the dojo source.

There are a number of areas in my application where this is a problem, but I've just hit one that I can't figure out how to work around. I'm trying trigger a 1 second spotlight animation on a tree node once the node has been made visible, but there is no way for me to do it. I can't connect to the _wipeIn or _wipeOut animations directly because they are lazily initialized. I can't connect to expand or collapse because animations are asynchronous so the connect will trigger before the expand. I can't just trigger the spotlight before the expan call, because the node may not exist yet.

comment:3 Changed 13 years ago by bill

Description: modified (diff)
Milestone: 1.0tbd

How about if onOpen and onClose were called after the respective animations completed, rather than when they started?

comment:4 Changed 13 years ago by bill

Milestone: tbdfuture
Summary: dijit._TreeNode does not call "_afterExpand" and "_afterCollapse" methodsTree: dijit._TreeNode does not call "_afterExpand" and "_afterCollapse" methods

Still waiting for answer...

comment:5 Changed 10 years ago by bill

Resolution: wontfix
Status: reopenedclosed
Note: See TracTickets for help on using tickets.