<div id="tree">div>
$(function () {
                function getTree() {
                    var data = [{
                        text: "p1",
                        nodes: [{ text: "p1-1", id: '00001', nodeId: '00001' }, { text: "p1-2", id: '00002' }, { text: "p1-3", id: '00003' }, { text: "p1-4", id: '00004', nodes: [{ text: 'p1-1-1', id: '00005'}]}]

                    }]
                    return data;
                }
                $('#tree').treeview({
                    data: getTree(),         // data is not optional
                    levels: 5,
                    showCheckbox: true,
                    multiSelect: false,
                    showBorder: false
                });

            })

API可参考:https://www.cnblogs.com/tangzeqi/p/8021637.html

posted on 2018-08-08 08:12  ctsx  阅读(108)  评论(0编辑  收藏  举报