jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree Knockout data bind, add new element to tree

This topic contains 1 reply, has 2 voices, and was last updated by  fbar 11 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • Pavlov
    Member

    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!


    fbar
    Member

    Has anyone find a solution ?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.