public/javascripts/yui/calendar/calendar.js
function() {

        if (this.beforeDestroyEvent.fire()) {
            var cal = this;

            // Child objects
            if (cal.navigator) {
                cal.navigator.destroy();
            }

            if (cal.cfg) {
                cal.cfg.destroy();
            }

            // DOM event listeners
            Event.purgeElement(cal.oDomContainer, true);

            // Generated markup/DOM - Not removing the container DIV since we didn't create it.
            Dom.removeClass(cal.oDomContainer, cal.Style.CSS_WITH_TITLE);
            Dom.removeClass(cal.oDomContainer, cal.Style.CSS_CONTAINER);
            Dom.removeClass(cal.oDomContainer, cal.Style.CSS_SINGLE);
            cal.oDomContainer.innerHTML = "";

            // JS-to-DOM references
            cal.oDomContainer = null;
            cal.cells = null;

            this.destroyEvent.fire();
        }
    }
function() {

        if (this.beforeDestroyEvent.fire()) {
            var cal = this;

            // Child objects
            if (cal.navigator) {
                cal.navigator.destroy();
            }

            if (cal.cfg) {
                cal.cfg.destroy();
            }

            // DOM event listeners
            Event.purgeElement(cal.oDomContainer, true);

            // Generated markup/DOM - Not removing the container DIV since we didn't create it.
            Dom.removeClass(cal.oDomContainer, cal.Style.CSS_WITH_TITLE);
            Dom.removeClass(cal.oDomContainer, cal.Style.CSS_CONTAINER);
            Dom.removeClass(cal.oDomContainer, cal.Style.CSS_SINGLE);
            cal.oDomContainer.innerHTML = "";

            // JS-to-DOM references
            cal.oDomContainer = null;
            cal.cells = null;

            this.destroyEvent.fire();
        }
    }
function ( ) { if ( this . beforeDestroyEvent . fire ( ) ) { var cal = this ; // Child objects if ( cal . navigator ) { cal . navigator . destroy ( ) ; } if ( cal . cfg ) { cal . cfg . destroy ( ) ; } // DOM event listeners Event . purgeElement ( cal . oDomContainer , true ) ; // Generated markup/DOM - Not removing the container DIV since we didn't create it. Dom . removeClass ( cal . oDomContainer , cal . Style . CSS_WITH_TITLE ) ; Dom . removeClass ( cal . oDomContainer , cal . Style . CSS_CONTAINER ) ; Dom . removeClass ( cal . oDomContainer , cal . Style . CSS_SINGLE ) ; cal . oDomContainer . innerHTML = "" ; // JS-to-DOM references cal . oDomContainer = null ; cal . cells = null ; this . destroyEvent . fire ( ) ; } }
Destroys the Calendar instance. The method will remove references
to HTML elements, remove any event listeners added by the Calendar,
and destroy the Config and CalendarNavigator instances it has created.

@method destroy
Destroys the Calendar instance . The method will remove references to HTML elements remove any event listeners added by the Calendar and destroy the Config and CalendarNavigator instances it has created .