Combotree 实现树结构-前台页面点击某个结点,input框为xx-xx-xx内容

    //加载目录树

        $("#column").combotree({

        //后台遍历树结点方法,返回json    

           url : path + "/op/queryPublishColumn.do?id="+id,

            width : '100%',
            height : 34,
            onLoadSuccess: function (node, data) {  
                if (data != null) {  
                    node = $('#selShenqFuwujg').combotree("tree").tree("find", data);  
                }  
            },   
            onSelect: function (dirId) {  
                   //此方法onselect点击后input框xx-xx-xx内容失败,改为onChange
            },
            onChange: function() {
                var tree = $('#column').combotree('tree');
                var selectedNode = tree.tree('getSelected');
                if (selectedNode) {
                    var path = new Array();  
                    do {  
                        path.unshift(selectedNode.text);  
                        selectedNode = tree.tree('getParent', selectedNode.target);  
                    } while (selectedNode);  
                    var pathStr = '';  
                    for (var i = 0; i < path.length; i++) {  
                        pathStr += path[i];  
                        if (i < path.length - 1) {  
                            pathStr += '-';  
                        }  
                    }
                    $('#column').combotree('setValue' , pathStr);
                }
            }

        });

附jsp定义及后台代码:

Combotree 实现树结构-前台页面点击某个结点,input框为xx-xx-xx内容

Combotree 实现树结构-前台页面点击某个结点,input框为xx-xx-xx内容