Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ydn-javascript] Destroy YUI panel on hide

Expand Messages
  • Christian Tiberg
    Destroying a panel in an event fired by it won t work, as far as I can tell. I d recommend using setTimeout or similar to destroy the panel after some short
    Message 1 of 2 , May 28, 2009
      Destroying a panel in an event fired by it won't work, as far as I can tell. I'd recommend using setTimeout or similar to destroy the panel after some short period of time, like 100ms.

      Best regards,
       Christian Tiberg


      2009/5/28 iacovlev.pavel <iacovlev.pavel@...>


      Good day all,

      I want to destroy an YUI panel instance by clicking the [x] of the panel. The panel gets destroyed but an error is triggered: "this.configChangedEvent is null". How do I fix it ?

      My code:

      this.statsPanel = new YAHOO.widget.Panel('rastercutStatsPanel', {
      fixedcenter: this.fixedcenter,
      visible: false,
      width:"500px",
      height:"500px",
      constraintoviewport: this.constraintoviewport
      });
      this.statsPanel.setHeader(Y.gis.translate.rastercutStatsHeader);
      this.statsPanel.setBody(this.getLoadingImage());
      this.statsPanel.render("panelContainer");
      this.statsPanel.show();

      this.statsPanel.hideEvent.subscribe(function() {
      this.destroy();
      }, this.statsPanel, true);

      P.S. I don't want to reuse the panel, I want it destroyed.


    Your message has been successfully submitted and would be delivered to recipients shortly.