jstree add toggle Node used json fomat

24 Views Asked by At

now i m use jstree and if parent Node have child, want make toggle button on left parent Node

    jsondata.push({ "id": id, "parent": parentID, "text": name,"a_attr": {
      "href": path,
    } });
    // update tree status
    $('#tree').jstree(true).settings.core.data = jsondata;

and if ParentID = id have child, parent Node : (id not parentID) side make toggle button

// data is if have child by id node, return true
// not have child return false
          if(data) {
            $('#tree').jstree(true).toggle_node(id);
          }

but it is not work

i see public document, if use toggle_node(id), it node will make toggle node, but is not working

sorry, my low english grammar and thanks

0

There are 0 best solutions below