View Full Version : How to get "items" back after setting html of Panel?

22 Aug 2009, 1:01 PM
I have a panel that contains many items in the items collection. Based on certain action, I execute:

this.body.update('<div class="x-grid-empty">There are no items to show</div>');
At some point later, I need to then clear the body text set above, and redisplay the origional items. Is this possible? Or does calling body.update destroy the items collection?

23 Aug 2009, 12:10 AM
body.update destroys the DOM representation of the items, so the items aren't destroyed, but they are unusable.

You should NEVER do this, because it creates a memory leak!

Would masking the body also work for you?

this.body.mask('There are no items to show');

Otherwise I would recommend a card layout with the items on one card and a single BoxComponent with your text on the second card.

23 Aug 2009, 12:13 AM

23 Aug 2009, 7:57 AM
I got the body.update idea from some post on this forum so I thought it was okay to use, guess not... I don't like the mask idea because I'm guessing it would still show the underlying items. I'll try the card layout route I guess. Thanks.