Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Removing ContentPanel deletes underlying element?

  1. #1
    Sencha User jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747

    Default Removing ContentPanel deletes underlying element?

    When I remove a ContentPanel from a Region and then re-add a new panel pointing to the same <div>, the content is blank. It's as if the innerHTML was been wiped out. What gives? How would I go about recycling contentpanels and/or the underlying elements within contentpanels?

    Thanks!

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    I'm not sure about why it would be empty. It's not a grid is it?

    The preferred way to recycle one would be something like:

    // p can reused later
    var p = layout.getRegion('west').remove('yourid');
    // or added to a diff region
    layout.getRegion('east').add(p);

  3. #3
    Sencha User jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747

    Default

    I've tried saving the panel upon removable (handled the "panel removed" event) and re-adding to the same region, and I also tried saving the panel upon creation [var p = layout.add('center', new YAHOO.ext.ContentPanel('id', {...}));], and even tried creating a new ContentPanel but using the same 'id' of the <div>...nothing proved to work...when I would add the new panel, it's contents would be blank.

    Quite strange...I'll tinker around today with it...

  4. #4
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    What in it... just normal HTML?

  5. #5
    Sencha User jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747

    Default

    Yep. I'm gonna hit it up a little later this afternoon and I'll see if I can figure out what the deal is.

  6. #6
    Sencha User jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747

    Default

    Code:
    if (typeof this.**** == 'undefined') {
                    this.**** = layout.add('center', new YAHOO.ext.ContentPanel(
                        YAHOO.ext.DomHelper.append(document.body, {
                            tag: 'div',
                            html: '****ing ****!'
                        }, true),
                        {
                            title: '****',
                            fitToFrame: true,
                            closable: true
                        }
                    ));
                }
                else {
                    layout.getRegion('center').add(this.****);
                    alert(this.****.el.dom.innerHTML);
                }
    If I add a panel to the layout and save it in "this.****", and then click the close button on the panel (which removes the panel from the this.panels MixedCollection) and then readd the panel a second time, it's html contents are blank. The alert pops up as blank. Somewhere, either el.update() is getting called, or the dom node is getting hosed along the way. Can you help me? :-) I don't want to have to regenerate all the HTML content of a panel just because it was closed.

  7. #7
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    I agree, that's ****.

    It used to work, I must have broken it. I had drag and drop of panels from on region to another working at one point and it removed/added them so I know it worked. I will look at it first thing when I wake up. Right now I don't think I could find anything, the brain is shot.

  8. #8
    Sencha User jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747

    Default

    Fair enough man, get some rest. Appreciate it! =)

  9. #9
    Sencha User jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747

    Default

    Is anyone else having this issue? This is rendering my ability to do anything impossible. I'm at a stalemate until this is figured out :-(

  10. #10
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    I'm on top of it now. I'll let you know when I figure it out.

Page 1 of 2 12 LastLast

Similar Threads

  1. accessing and updating underlying xml from the grid-Ext 1.0
    By Eric_ht in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 21 Mar 2007, 1:52 PM
  2. Problem removing dialog
    By Nullity in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 27 Feb 2007, 7:01 AM
  3. Removing borders from dialogs
    By gfraser in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 20 Dec 2006, 7:05 PM
  4. Element.removeListener never removing handlers!
    By Animal in forum Ext 1.x: Bugs
    Replies: 2
    Last Post: 3 Dec 2006, 5:30 AM
  5. Removing the last tab
    By mohaqa in forum Ext 1.x: Help & Discussion
    Replies: 9
    Last Post: 14 Oct 2006, 9:57 AM

Posting Permissions

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