function tree_erzeugen()
{
var adiv = document.getElementById("treepos");
var tree = document.createElement("tree");
tree.setAttribute("id","my-tree");
tree.setAttribute("flex","1");
tree.setAttribute("hidecolumnpicker","false");
tree.setAttribute("seltype","single");
tree.setAttribute("class","tree");
tree.setAttribute("rows","5");
tree.setAttribute("onselect","treeRowClicked()");
adiv.appendChild(tree);
var atree = document.getElementById("my-tree");
atree.appendChild(document.createElement("treecols"));
var treecol = document.createElement("treecol");
treecol.setAttribute("primary","true");
treecol.setAttribute("flex","2");
treecol.setAttribute("label","Anlage");
treecol.setAttribute("persist","width");
treecol.setAttribute("ordinal","1");
atree.appendChild(treecol);
var splitter = document.createElement("splitter");
splitter.setAttribute("primary","true");
splitter.setAttribute("class","tree-splitter");
splitter.setAttribute("ordinal","2");
atree.appendChild(splitter);
var treechild = document.createElement("treechildren");
treechild.setAttribute("idprimary","true");
atree.appendChild(treechild);
atree.appendChild(document.createElement("treechildren"));
/* hier wiederholen sich die Anlagen */
var treeitem = document.createElement("treeitem");
treeitem.setAttribute("container","true");
treeitem.setAttribute("open","true");
atree.appendChild(treeitem);
atree.appendChild(document.createElement("treerow"));
var treecell = document.createElement("treecell");
treecell.setAttribute("label","Z");
atree.appendChild(treecell);
atree.appendChild(document.createElement("treechildren"));
/* Hier pro Unterpunkt wiederholen (Varname) */
atree.appendChild(document.createElement("treeitem"));
atree.appendChild(document.createElement("treerow"));
treecell = document.createElement("treecell");
treecell.setAttribute("label","stoerung_1");
atree.appendChild(treecell);
atree.appendChild(document.createElement("treeitem"));
atree.appendChild(document.createElement("treerow"));
treecell = document.createElement("treecell");
treecell.setAttribute("label","stoerung_2");
atree.appendChild(treecell);
/* hier wiederholen sich die Anlagen */
treeitem = document.createElement("treeitem");
treeitem.setAttribute("container","true");
treeitem.setAttribute("open","true");
atree.appendChild(treeitem);
atree.appendChild(document.createElement("treerow"));
treecell = document.createElement("treecell");
treecell.setAttribute("label","M1");
atree.appendChild(treecell);
atree.appendChild(document.createElement("treechildren"));
/*----------------------------------------*/
atree.appendChild(document.createElement("treeitem"));
atree.appendChild(document.createElement("treerow"));
treecell = document.createElement("treecell");
treecell.setAttribute("label","stoerung_3");
atree.appendChild(treecell);
atree.appendChild(document.createElement("treeitem"));
atree.appendChild(document.createElement("treerow"));
treecell = document.createElement("treecell");
treecell.setAttribute("label","stoerung_4");
atree.appendChild(treecell);
}