I have seen other questions with the same issue , the data seems the be the issue most of the time.
I did create a jsfiddle http://jsfiddle.net/gwvoqns8/
(always keep in mind that http has to be used, and not https )
that should demonstrate the problem
- I want to have whatever is typed into the text box to display as another named node of whatever name...
- The code I'm using seems to enforce me to selected an existing parent node and i do not want that.
Its a bit annoying why it is saying "undefined"
$("#addTopLevel").click(function () {
console.log('in this');
if (treeview.select().length) {
console.log('1');
treeview.append({
text: $("#appendNodeText").val()
}, treeview.select());
} else {
//alert("please select tree node");
console.log('2');
}
});
I was noticing that you could just do this
However, OP answer would be better as then you will have the ability to add to children nodes if you wanted to, even though so said you didn't want to.
cheers
Try this: