diff --git a/phpgwapi/js/egw_action/egw_action.js b/phpgwapi/js/egw_action/egw_action.js index a9b7cd6f06..17d0b86e5c 100644 --- a/phpgwapi/js/egw_action/egw_action.js +++ b/phpgwapi/js/egw_action/egw_action.js @@ -850,6 +850,27 @@ egwActionObject.prototype.clear = function() { this.focusedChild = null; } +/** + * Deletes this object from the parent container + */ +egwActionObject.prototype.remove = function() { + // Remove focus and selection from this element + this.setFocused(false); + this.setSelected(false); + this.setAllSelected(false); + + // Clear the child-list + this.clear(); + + // Remove this element from the parent list + if (this.parent != null) + { + var idx = this.parent.children.indexOf(this); + + this.parent.children.splice(idx, 1); + } +} + /** * Searches for the root object in the action object tree and returns it. */