You may also want to read the documentation on create, type creatable setting and the createat config option. When passing data (attributes, title) when creating a node - please follow the JSON datastore format. When creating the beforecreate and oncreate callbacks are triggered.
1.
$(
function
() {
2.
$(
"#demo_1"
).tree();
3.
});
1.
<
input
type
=
"button"
onclick
=
"var t = $.tree.focused(); if(t.selected) t.create(); else alert("
Select a node first");"
value
=
"Simple Create"
>
2.
<
input
type
=
"button"
onclick
=
"$.tree.focused().create(false,"
#phtml_2");"
value
=
"Create in a parent"
>
3.
<
input
type
=
"button"
onclick
=
"$.tree.focused().create({ data : "
Child node 3" }, "#phtml_1", 2);"
value
=
"Create with data at a point"
>
4.
<
input
type
=
"button"
onclick
=
"$.tree.focused().create({ data : "
Root node 3" }, -1);"
value
=
"Create a root node"
>