treeView 使用java+js写的树,可以展开和折叠

treeView 使用java+js写的树,使用datatable-tree.css修饰 只能展开不能折叠,是什么原因

js 代码

function getUnit(){
                        $.ajax({
                            async : false,
                            cache : false,
                            dataType: "json",
                            type : "POST",
                            url : '<%=basePath%>cadre/getUnitTree.do',
                            success : function (data){
                                    $.each(data.pds ,function (i ,item){//changeTree是触发函数
                                            var tree = '<ul><li><span><i class="glyphicon glyphicon-folder-open"></i><a onclick="changeTree('+item.UNIT_ID+',\''+item.UNIT_NAME+'\');" style="text-decoration:none;margin-left:4px;cursor:pointer">'+item.UNIT_NAME+'</a></span>';
                                            if(item.child!=null){
                                                tree=Fib(item.child,tree);
                                            }
                                            tree=tree+'</li></ul>';
                                            $("#tree").append(tree);
                                    });
                            }
                        });
                            $('unit-.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
                            $('.unit-ree li.parent_li > span > i').on('click', function (e) {
                                var children = $(this).parent('span').parent('li.parent_li').find(' > ul > li');
                                if (children.is(":visible")) {
                                    children.hide('fast');
                                    $(this).parent('span').attr('title', 'Expand this branch').find(' > i').addClass('glyphicon glyphicon-plus-sign').removeClass('glyphicon glyphicon-minus-sign');
                                } else {
                                    children.show('fast');
                                    $(this).parent('span').attr('title', 'Collapse this branch').find(' > i').addClass('glyphicon glyphicon-minus-sign').removeClass('glyphicon glyphicon-plus-sign');
                                }
                                e.stopPropagation();
                            });
                        }

                        function Fib(pds,tree){
                            tree = tree + '<ul>';
                            for(var i = 0;i < pds.length;i++){
                                if(pds[i].child != null){
                                    tree = tree + '<li><span><i class="glyphicon glyphicon-minus-sign"></i><a ondblclick="changeTree('+pds[i].UNIT_ID+',\''+pds[i].UNIT_NAME+'\');" style="text-decoration:none;margin-left:4px;cursor:pointer">'+pds[i].UNIT_NAME+'</a></span>';
                                    tree = Fib(pds[i].child,tree);
                                }else{
                                    tree = tree + '<li><span><i class="glyphicon glyphicon-leaf"></i><a ondblclick="changeTree('+pds[i].UNIT_ID+',\''+pds[i].UNIT_NAME+'\');" style="text-decoration:none;margin-left:4px;cursor:pointer">'+pds[i].UNIT_NAME+'</a></span>';
                                }
                                tree = tree + '</li>';
                            }
                            tree = tree + '</ul>';
                            return tree;
                        }

执行getUnit函数得到所有数据 ,就是不能折叠树怎么回事  ?    感觉问题出现在jsp页面 ,(注释:我的样式引用正确  bootstrap-treeview.css   bootstrap.css    js)

楼主,请你把代码搞上来啊。。凭空想不到