ChildEls: Array;
The ChildEls property determines child elements of the tree model parent element.
Use the setChildEls method to set the property value, and the getChildEls method to get the property value. Value cannot be set from JSON.
Parameters of the setChildEls method:
- parentKey: String. Parent key.
- mdEls: Array. Array of added objects.
- range: Object. Range of added elements.
- childrenCount: Number. Total number of child elements for parent element.
- filter: PP.Mb.ElsFilter. Filter set for all loaded elements.
- odId :Object. Dimension moniker.
Parameters of the getChildEls method:
- key: String. Parent key.
- range: Object. Range of obtained elements.
- filter: PP.Mb.ElsFilter. Filter, to which child elements satisfy.
- odId :Object. Dimension moniker.
To execute the example, the HTML page must contain the MetaTree component named metaTree (see MetaTree Constructor). Expand all tree elements:
metaTree.expandAll();
Now display only the elements that do not have child elements.
var elements = []; // Get all tree elements getChildElements(""); function getChildElements(key) { var childEls = metaSource.getChildEls(key); for(var i in childEls) { if(childEls[i].childrenCount) { getChildElements(childEls[i].k.toString()); } else { elements.push(childEls[i]); } } } // Set elements metaSource.setChildEls("", elements); // Refresh tree of elements metaTree.refreshAll();
After executing the example only the elements that do not have child elements are displayed:
See also: