dist/jscow.js
function(cmp) {	
					
					// Remove the component reference from parent children list
					if (typeof cmp !== 'undefined' && typeof cmp === 'object') {
						
						$(this.children()).each((function(self, cmp) {
							return function(i,c) {

								if (c.id() === cmp.id()) {
									self.__children__.splice(i,1);
								}

							};
						})(this, cmp));

					} else {

						// Call to remove the component reference from parent children list
						if (typeof this.parent() !== 'undefined' && this.parent()) {
							this.parent().del(this);
						}
						
						// Remove the component domelemeents and delete the component instance from global jscow instance list
						$(jsCow.componentsObjectList).each((function(self) {
							return function(i, c) {
								if (c !== 'undefined' && c.id() === self.id()) {
									c.view().removeAll();
									jsCow.componentsObjectList.splice(i,1);
								}
							};
						})(this));

						// Delete children components of the component to be delete
						var list = this.__children__;
						if (list.length > 0) {
							$(list).each(function(i,c) {
								c.del();
							});
						}
						
					}
					
					return this;
				}
function(cmp) {	
					
					// Remove the component reference from parent children list
					if (typeof cmp !== 'undefined' && typeof cmp === 'object') {
						
						$(this.children()).each((function(self, cmp) {
							return function(i,c) {

								if (c.id() === cmp.id()) {
									self.__children__.splice(i,1);
								}

							};
						})(this, cmp));

					} else {

						// Call to remove the component reference from parent children list
						if (typeof this.parent() !== 'undefined' && this.parent()) {
							this.parent().del(this);
						}
						
						// Remove the component domelemeents and delete the component instance from global jscow instance list
						$(jsCow.componentsObjectList).each((function(self) {
							return function(i, c) {
								if (c !== 'undefined' && c.id() === self.id()) {
									c.view().removeAll();
									jsCow.componentsObjectList.splice(i,1);
								}
							};
						})(this));

						// Delete children components of the component to be delete
						var list = this.__children__;
						if (list.length > 0) {
							$(list).each(function(i,c) {
								c.del();
							});
						}
						
					}
					
					return this;
				}
function ( cmp ) { // Remove the component reference from parent children list if ( typeof cmp !== 'undefined' && typeof cmp === 'object' ) { $ ( this . children ( ) ) . each ( ( function ( self , cmp ) { return function ( i , c ) { if ( c . id ( ) === cmp . id ( ) ) { self . __children__ . splice ( i , 1 ) ; } } ; } ) ( this , cmp ) ) ; } else { // Call to remove the component reference from parent children list if ( typeof this . parent ( ) !== 'undefined' && this . parent ( ) ) { this . parent ( ) . del ( this ) ; } // Remove the component domelemeents and delete the component instance from global jscow instance list $ ( jsCow . componentsObjectList ) . each ( ( function ( self ) { return function ( i , c ) { if ( c !== 'undefined' && c . id ( ) === self . id ( ) ) { c . view ( ) . removeAll ( ) ; jsCow . componentsObjectList . splice ( i , 1 ) ; } } ; } ) ( this ) ) ; // Delete children components of the component to be delete var list = this . __children__ ; if ( list . length > 0 ) { $ ( list ) . each ( function ( i , c ) { c . del ( ) ; } ) ; } } return this ; }
Delete a component and remove all related dom elements.

@method del
@param {Object} [optional] cmp Instance of the component to be deleted
@return {Object} Reference to the current component instance object
@chainable
Delete a component and remove all related dom elements .