mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:38 +01:00
delete a leaf of the tree
This commit is contained in:
parent
85a198d9e6
commit
090f8b134e
@ -421,6 +421,27 @@ var et2_tree = et2_inputWidget.extend(
|
||||
if (typeof _label != 'undefined') this.input.setItemText(_newItemId,_label);
|
||||
},
|
||||
|
||||
/**
|
||||
* deleteItem, deletes an item by id
|
||||
* @param _id ID of the node
|
||||
* @param _selectParent select the parent node true/false
|
||||
* @return void
|
||||
*/
|
||||
deleteItem: function(_id, _selectParent) {
|
||||
if(this.input == null) return null;
|
||||
this.input.deleteItem(_id, _selectParent);
|
||||
// Update action
|
||||
// since the action ID has to = this.id, getObjectById() won't work
|
||||
var treeObj = egw_getAppObjectManager().getObjectById(this.id);
|
||||
for(var i=0; i < treeObj.children.length; i++)
|
||||
{
|
||||
if(treeObj.children[i].iface && treeObj.children[i].iface.id == _id)
|
||||
{
|
||||
delete treeObj.children[i].iface;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* setLabel, sets the Label of of an item by id
|
||||
* @param _id ID of the node
|
||||
|
Loading…
Reference in New Issue
Block a user