Mdb
Mdb

Reputation: 8568

Add node to KendoUI TreeView does not work as expected

I am researching the Kendo TreeView widget from the documentation. I am trying to add a predefined node (which is a div with some input elements) to a TreeView structure. This is the example I follow:

http://demos.kendoui.com/web/treeview/api.html

I am able to append the node only once and it disappears. I am not very familiar with jquery and javascript so any help with working example will be greatly appreciated. Here is jsfiddle sample:

http://jsfiddle.net/MwHNd/454/

To reproduce the bug, try to add the node with AppendNode button several times. Thank You!

Upvotes: 0

Views: 1896

Answers (1)

Hasith
Hasith

Reputation: 1767

change

 treeview.append($("#text"), selectedNode);

to

treeview.append($("#text").clone(), selectedNode);

The issue is you are appending the same element so it get detached and re-atached.

Upvotes: 1

Related Questions