Sochettra / dynatree

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

Ephemeral error on node.reloadChildren() in FF 7.0.1 #231

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The error is rather ephemeral and raises only from time to time.

I uses:
 - Dynetree v1.2.0 (minimized version)
 - jQuery 1.5.2 (I cant use 1.6.4 because of some problems on IE8)
 - Firefox 7.0.1

In my web I have a tree with only one lazy "root" node.
If I expands that node, all subnodes loads fine. Than I do some drag and drop 
job to change its order and/or hierarchy. 
After that sometimes I needs to undo all changes so I reloads my lazy "root" 
node with code:

  $("#tree").dynatree("getTree").getNodeByKey("menuRoot").reloadChildren();

unfortunately from time to time I got error:
uncaught exception: [Exception... "Component returned failure code: 0x80004003 
(NS_ERROR_INVALID_POINTER) [nsIDOMHTMLUListElement.removeChild]"  nsresult: 
"0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: 
http://localhost/jquery.dynatree.js :: <TOP_LEVEL> :: line 137"  data: no]

I've no idea why "ul" element don't have "removeChild" method but it seems that 
I can fix that problem by simple modification of dynatree code:

jquery.dynatree.js line 1394:
  if(this.ul){
    this.ul.removeChild(tn.li);
  }

  change to:

  $('li',$(this.ul)).remove()}

jquery.dynatree.min.js line 137:
  tn.removeChildren(true,retainPersistence);if(this.ul){this.ul.removeChild(tn.li);}}

  change to:
  tn.removeChildren(true,retainPersistence);$('li',$(this.ul)).remove()}

Original issue reported on code.google.com by dariusz....@gmail.com on 6 Oct 2011 at 7:49

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 11 Oct 2011 at 7:59

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r561.

Original comment by moo...@wwwendt.de on 28 Dec 2011 at 12:25