diff --git a/etemplate/js/et2_widget_tree.js b/etemplate/js/et2_widget_tree.js index 3c99dbd05c..cfcfc5189a 100644 --- a/etemplate/js/et2_widget_tree.js +++ b/etemplate/js/et2_widget_tree.js @@ -393,6 +393,42 @@ var et2_tree = et2_inputWidget.extend({ // no support for multiple selections // as there is no get Method to return the full selected node, we use this return this.options.multiple ? null : this.input._selected[0]; + }, + + /** + * getTreeNodeOpenItems + * + * @param _nodeID, the nodeID where to start from (initial node) + * @param mode, the mode to run in: forced fakes the initial node openState to be open + * @return structured array of node ids: array(message-ids) + */ + getTreeNodeOpenItems: function (_nodeID, mode) { + if(this.input == null) return null; + var z = this.input.getSubItems(_nodeID).split(","); + var oS; + var PoS; + var rv; + var returnValue = [_nodeID]; + var modetorun = "none"; + if (mode) { modetorun = mode } + PoS = this.input.getOpenState(_nodeID) + if (modetorun == "forced") PoS = 1; + if (PoS == 1) { + for(var i=0;i