Hy all!
I would like to create a jqtree with databinding wich is ok, but I can’t add a new item to tree, because I can’t get the selected BINDED element from viewmodel. I just get the tree item, how can I get the model object of selected tree node for add a new item to it?
My tree is hierarhical I store two type of element, first is Folder how has items, and the second type of node is File wich doesnt have items (items : null), but it has value wich is observable String.
Folder= function (name, items) {
this.label = name;
this.items = ko.observableArray(items);
this.icon = "icon-folder-open"
}
File= function (name, code, lang) {
this.label = name;
this.value = ko.observable(code);
this.icon = "icon-file";
this.items = null;
}
Thanks for the asnwer!