參考文檔:html
https://www.cnblogs.com/luozhihao/p/4679050.htmlnode
http://jsfiddle.net/vakata/2kwkh2uL/5/ url
核心的關鍵點是:spa
組裝節點的children元素時,設置 children = true.net
$('#jstree_company').jstree({ "core": { "animation": 0, "check_callback": true, "themes": { "stripes": true }, 'data': { 'url': function (node) { return '/IS/CDictionary/GetDictionTree'; }, 'data': function (node) { return { 'id': node.id,'type':'company' }; } } }, "plugins": ["contextmenu", "dnd"], });
組裝的後臺代碼:code
JSTree treeFlow = new JSTree() { id = item.DictID.ToString(), parent = id, text = item.Title, state = new NodeState() { opened = false }, children = true }; trees.Add(treeFlow);