mmalinowski42 / dynatree

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

TypeError: parent.li is (sometimes) null at line 411 #495

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Called activate() on a node, but only fails 25% of the time

What is the expected output? What do you see instead?
In the Firefox console:

"13:19:24.743 - bind(" Object { originalEvent: click, type: "click", 
isDefaultPrevented: returnFalse(), timeStamp: 139497805, 
jQuery19102235185644524572: true, toElement: undefined, screenY: 752, screenX: 
117, pageY: 650, pageX: 112, 22 more… } "): dtnode: " Object { parent: 
Object, tree: Object, data: Object, li: <li>, span: 
<span.dynatree-node.dynatree-exp-c.dynatree-ico-c.dynatree-focused>, ul: null, 
childList: null, _isLoading: false, hasSubSel: false, bExpanded: false, 1 
more… } ", error: " TypeError: parent.li is null
Stack trace:
DynaTreeNode.prototype.render@http://localhost:8162/dynatree/jquery.dynatree.js:
411:6
storeNode@http://localhost:8162/tree-ui.js:432:35
initTree/<.onQueryActivate@http://localhost:8162/tree-ui.js:77:6
DynaTreeNode.prototype._activate@http://localhost:8162/dynatree/jquery.dynatree.
js:843:47
DynaTreeNode.prototype.activate@http://localhost:8162/dynatree/jquery.dynatree.j
s:889:3
DynaTreeNode.prototype._userActivate@http://localhost:8162/dynatree/jquery.dynat
ree.js:928:4
DynaTreeNode.prototype._onClick@http://localhost:8162/dynatree/jquery.dynatree.j
s:1262:4
.bind/<@http://localhost:8162/dynatree/jquery.dynatree.js:3000:84
jQuery.event.dispatch@http://localhost:8162/bootstrap/js/jquery/js/jquery-1.9.1.
js:3073:15
jQuery.event.add/elemData.handle@http://localhost:8162/bootstrap/js/jquery/js/jq
uery-1.9.1.js:2750:6
 jquery.dynatree.js:54

What version of the dynatree and jQuery are you using?
dynatree 1.2.6
jQuery 1.9.1
jQuery-UI 1.10.3

On what operating system and browser?
Mac OS X 10.10.2, Firefox 35.0.1

What DOCTYPE declaration are you using?
<!DOCTYPE html>

Please provide any additional information below.

activate() is being called by an onClick event from an "<a>" link.  When 
onQueryActivate() fires with the second argument 'true', my code does some 
validation work that takes a few milliseconds before deciding if it's ok to 
return true.  The error only occurs when that returns true of course, since the 
node wouldn't activate otherwise.  Since it happens somewhat randomly, it 
sounds like a timing/thread problem?  

Original issue reported on code.google.com by Chris.Ja...@gmail.com on 11 Feb 2015 at 6:45

GoogleCodeExporter commented 9 years ago
Seems you are triggering the render function inside onQueryActivate(?).
Can you post the code of that event handler (or even better set up a jsFiddle 
that reproduces the problem)?

Original comment by moo...@wwwendt.de on 12 Feb 2015 at 7:10