View Full Version : Ext.appendChild(..) detach child from existing parent first
sjivan
7 Jun 2007, 4:48 AM
Does Element.appendChild(child) try to detach the child if it already has a parent before attaching to the new Element? I scanned throught the source and it does not seem to be the case but I could be wrong. If it doesnt detach itselft from previous parent, can the behaviour be changed for it to do so?
Thanks,
Sanjiv
Animal
7 Jun 2007, 5:07 AM
Ext.Elements do not keep track of their parent node. The underlying DOM element does. Appending a DOM element to another DOM element removes that child from its old parent.
Try it using DOM calls.
http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html
sjivan
7 Jun 2007, 5:10 AM
cool, thanks!
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.