My favorites | Sign in
Project Home Downloads
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 169: onRender callback
1 person starred this issue and may be notified of changes. Back to list
Status:  Verified
Owner:  moo...@wwwendt.de
Closed:  Jan 2011


 
Reported by ekemo...@gmail.com, Jan 12, 2011
What new or enhanced feature are you proposing?
A callback that would be notified when a node is rendered

What goal would this enhancement help you achieve?
It will allow for processing that depends on the node being rendered...for instance context menu bindings.
Jan 13, 2011
Project Member #1 moo...@wwwendt.de
Do you plan to bind() mouse events, as soon as a node element was rendered?
In this case onRender should fire *after* the node was rendered, i guess.
(I would prefer to use event delegation in this use case, rebinding would not be neccessary).
Status: Waiting
Jan 14, 2011
#2 ekemo...@gmail.com
I intend to bind after the node is rendered...I think you're right, I can use JQuery's live function to monitor when nodes are rendered...but I guess a convenience callback within dynatree wouldn't hurt either:)
Jan 14, 2011
Project Member #3 moo...@wwwendt.de
true
Status: Accepted
Labels: Milestone-Discussion
Jan 15, 2011
#5 ekemo...@gmail.com
The patch for this is in DynaTreeNode.render, to replace this line:

this.span.innerHTML = this._getInnerHtml();

with :

this.span.innerHTML = this._getInnerHtml();
if(opts.onRender){
opts.onRender.call(this.tree,this,this.span);
}

OnRender provides the node and the dom element that represents the rendered node, in this case I am supplying the span element, but I am actually interested in the link element for the title (I am binding context menu to link element so I can also use DnD).

Jan 16, 2011
Project Member #6 moo...@wwwendt.de
(No comment was entered for this change.)
Summary: onRender callback
Owner: moo...@wwwendt.de
Labels: -Milestone-Discussion Milestone-Release1.0.4
Jan 16, 2011
Project Member #7 moo...@wwwendt.de
Thought: 
an additional 'onQueryRender' could be called *before* rendering.
It can be used to implement the rendering of the node's span/a tag (returning 'false' to stop default rendering).
Jan 16, 2011
#8 ekemo...@gmail.com
I would say yes, I didn't need that but it is a good bet that someone else might need it, you never know what sort of use cases are out there:) Since that callback is available for the other events, I'll recommend adding it for completeness.
Jan 23, 2011
Project Member #9 moo...@wwwendt.de
(No comment was entered for this change.)
Labels: Milestone-Release1.1.0
Jan 23, 2011
Project Member #10 moo...@wwwendt.de
(No comment was entered for this change.)
Status: Fixed
Jul 17, 2012
Project Member #11 moo...@wwwendt.de
considered verified
Jul 17, 2012
Project Member #12 moo...@wwwendt.de
(No comment was entered for this change.)
Status: Verified

Powered by Google Project Hosting