Results 1 to 2 of 2

Thread: [SOLVED] Simple DOM Append Question (How to remove?)

  1. #1
    Sencha User
    Join Date
    Mar 2008
    Location
    Marietta, GA
    Posts
    93

    Default [SOLVED] Simple DOM Append Question (How to remove?)

    What is the reverse of:

    Code:
    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
    Code:
    Ext.get( id ).remove();
    (hide() worked too, but not as well for me)


    Thanks, Jason
    Last edited by jasondeegan; 4 Jan 2010 at 7:05 AM. Reason: SOLVED
    Don't measure excellence against others, but rather against the best implementation of yourself.

  2. #2

    Default

    I'm guess as I have never used domhelper, but perhaps if you add an id, you can delete it by id?
    PHP Code:
    Ext.DomHelper.append'images' el, { tag'img'id'images'srcdata.imagestyle:'height:55; width:55; margin:10px; visibility:hidden;' }, true).showtrue ).frame(); 
    Then I think
    PHP Code:
    Ext.get('#images').destroy();
    Ext.get('#images').hide(); 
    should work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •