PDA

View Full Version : [SOLVED] Simple DOM Append Question (How to remove?)



jasondeegan
30 Dec 2009, 10:44 AM
What is the reverse of:



Ext.DomHelper.append( 'images' + el, { tag: 'img', src: data.image, style:'height:55; width:55; margin:10px; visibility:hidden;' }, true).show( true ).frame();


In other worse, I've added it, how do I get rid of it?

I've tried:
Ext.get( id ).destroy();
Ext.get( id ).hide();
and those don't work.
I researched the DomHelper and those functions all seem to ADD stuff to the DOM.

--- SOLUTION ---
Thanks NickWeavers for keeping me on the right track.
Adding the ID to the element you're appending and calling an
Ext.get( id ).remove(); (hide() worked too, but not as well for me)

Thanks, Jason

nickweavers
30 Dec 2009, 3:57 PM
I'm guess as I have never used domhelper, but perhaps if you add an id, you can delete it by id?


Ext.DomHelper.append( 'images' + el, { tag: 'img', id: 'images', src: data.image, style:'height:55; width:55; margin:10px; visibility:hidden;' }, true).show( true ).frame();

Then I think


Ext.get('#images').destroy();
Ext.get('#images').hide();

should work :-?