PDA

View Full Version : appendChild throws DOM Exception 8



rijkvanwel
16 Mar 2011, 7:07 AM
Hey guys,

What I'm trying to do here seems to be fairly basic, but I can't figure out why this doesn't work.. The documentation on this subject is somewhat unclear, for instance I don't really understand the difference between a DOM Helper element and an Ext.Element, and the Insertion methods of the DOM Helper class are mentioned in the comments but not in the Methods list. So I need some help here :)


targetEl = 'title';

// This works :)
Ext.get( targetEl ).createChild({
tag: 'div',
html: 'Child'
});

// This doesn't :(
var testEl = new Ext.Element({
tag: 'div',
html: 'TEST'
});
Ext.get( targetEl ).appendChild(testEl);


This is the error I see in the Chrome console:


Uncaught Error: NOT_FOUND_ERR: DOM Exception 8 - ext-all-debug.js:2034
appendTo - ext-all-debug.js:2034
appendChild - ext-all-debug.js:2029
teamSelect - SG.js:205
init - SG.Alignment.js:18
EXTUTIL.Event.name - ext-all-debug.js:190
call - ext-all-debug.js:1459