ChildEls: Array of Object
The ChildEls property sets an array of children for selected dictionary element.
Use the setChildEls (key, value) method to set array of children for selected dictionary element, and the getChildEls(key) method to get this array. The key parameter is used to set key of the parent element.
To execute the example, the HTML page must contain the DimensionTree component named dimTree. This component must use dictionary named "dim" as its source (see Example of Creating the DimensionTree Component). The dictionary must include an element with the keyYEARS: 2002. Let us set an array of children for the element with the specified key:
dim.setChildEls("YEARS: 2002", [
{
"k": "1",
"n": "First element",
"h": "1",
"o": "0"
},
{
"k": "2",
"n": "Second element",
"h": "0",
"o": "1"
},
{
"k": "3",
"n": "Third element",
"h": "0",
"o": "1"
},
{
"k": "4",
"n": "Fourth element",
"h": "0",
"o": "0"
}])
dimTree.refresh();
After executing the example the array of children is set for the dictionary element with the key YEARS: 2002. These children will be shown in the tree.
See also: