pcirella / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

Context menu is not bound to nodes that are hidden by collapsed node on load #173

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using Firefox 3.6.13 on Linux but also seems to be the same problem on 
Windows with Firefox and IE8 (haven't tried anything else). If you use the 
example Dynatree project with the context menu example, it shows the same 
characteristics. Load the page with the folders in a collapsed state and then 
expand and try to invoke the context menu on the nodes that were hidden - the 
standard browser context menu comes up. Load the page again with the nodes open 
(since the example has persistence), and the nodes that are visible at load 
time all have the context menu bound to them and it is invokable. I've also 
tried it with jeegoocontext and that has the same problem - binding of the 
context menu only happens to nodes that are not hidden at page load time.

Original issue reported on code.google.com by jonas.ba...@gmail.com on 19 Jan 2011 at 3:29

GoogleCodeExporter commented 9 years ago
That is to be expected, since qua design the node HTML elements do not exist 
until they are rendered the first time.
These possible solutions come to my mind:
- isn't that what live events where made for?
  I wonder why these plugins do not use live events or event delegation...
- ekemo suggested a workaround in issue 171. I will include his 'onRender' 
  patch in version 1.0.4
- I am thinking of adding a tree.renderAll() function, that would create all 
  elements, so you can bind. (This wouldn't help with lazy loading trees however)

Original comment by moo...@wwwendt.de on 20 Jan 2011 at 6:37

GoogleCodeExporter commented 9 years ago
It might be useful to have a method that would allow you to render down from a 
specific node that would deal with lazy loading. I don't know how feasible that 
would be to implement, but then at least you could render only that part of the 
tree after the lazy load.

Original comment by jonas.ba...@gmail.com on 20 Jan 2011 at 3:53

GoogleCodeExporter commented 9 years ago
The idea would be to have a node.renderChildren() function - or alike - that 
the user can call in the onLazyRead handler.
(tree.renderAll() would be implemented as tree.rootNode.renderChildren())

Original comment by moo...@wwwendt.de on 20 Jan 2011 at 5:06

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 23 Jan 2011 at 8:44

GoogleCodeExporter commented 9 years ago
New method tree.renderInvisibleNodes() forces creation of all HTML elements.
node.render() has new argument includeInvisible. 

Original comment by moo...@wwwendt.de on 23 Jan 2011 at 8:50

GoogleCodeExporter commented 9 years ago
Also started issue 174.

Original comment by moo...@wwwendt.de on 23 Jan 2011 at 9:45

GoogleCodeExporter commented 9 years ago
considered verified

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:16

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:19