Initial OpenECOMP Portal commit
[portal.git] / ecomp-portal-FE / client / bower_components / jqTree / _entries / 38_appendnode.md
diff --git a/ecomp-portal-FE/client/bower_components/jqTree/_entries/38_appendnode.md b/ecomp-portal-FE/client/bower_components/jqTree/_entries/38_appendnode.md
new file mode 100644 (file)
index 0000000..2eeea28
--- /dev/null
@@ -0,0 +1,50 @@
+---
+title: appendNode
+name: functions-appendnode
+---
+
+**function appendNode(new_node_info, parent_node);**
+
+Add a node to this parent node. If **parent_node** is empty, then the new node becomes a root node.
+
+{% highlight js %}
+var parent_node = $tree.tree('getNodeById', 123);
+
+$tree.tree(
+    'appendNode',
+    {
+        name: 'new_node',
+        id: 456
+    },
+    parent_node
+);
+{% endhighlight %}
+
+To add a root node, leave *parent_node* empty:
+
+{% highlight js %}
+$tree.tree(
+    'appendNode',
+    {
+        name: 'new_node',
+        id: 456
+    }
+);
+{% endhighlight %}
+
+It's also possible to append a subtree:
+
+{% highlight js %}
+$tree.tree(
+    'appendNode',
+    {
+        name: 'new_node',
+        id: 456,
+        children: [
+            { name: 'child1', id: 457 },
+            { name: 'child2', id: 458 }
+        ]
+    },
+    parent_node
+);
+{% endhighlight %}