easyui combotree不让父级选中

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了easyui combotree不让父级选中相关的知识,希望对你有一定的参考价值。

easyui combotree不让父级选中?

<ul id="combotree"></ul>
 $(function () {
        $("#combotree").combotree({
            width: 300,
            data: [{
                "id": 1,
                "text": "My Documents",
                "children": [{
                    "id": 11,
                    "text": "Photos",
                    "state": "closed",
                    "children": [{
                        "id": 111,
                        "text": "Friend"
                    }, {
                        "id": 112,
                        "text": "Wife"
                    }, {
                        "id": 113,
                        "text": "Company"
                    }]
                }, {
                    "id": 12,
                    "text": "Program Files",
                    "children": [{
                        "id": 121,
                        "text": "Intel"
                    }, {
                        "id": 122,
                        "text": "Java",
                        "attributes": {
                            "p1": "Custom Attribute1",
                            "p2": "Custom Attribute2"
                        }
                    }, {
                        "id": 123,
                        "text": "Microsoft Office"
                    }, {
                        "id": 124,
                        "text": "Games",
                        "checked": true
                    }]
                }, {
                    "id": 13,
                    "text": "index.html"
                }, {
                    "id": 14,
                    "text": "about.html"
                }, {
                    "id": 15,
                    "text": "welcome.html"
                }]
            }]
            ,
            method: ‘get‘,
            ines: true,
            multiple: true,
            onBeforeCheck: function (node) {
                //alert($("#combotree").combotree("tree").tree(‘isLeaf‘, node.target));
                if (!$("#combotree").combotree("tree").tree(‘isLeaf‘, node.target)) {
                    return false;
                }
            }
        })
    })

关键代码:

onBeforeCheck: function (node) {
                //alert($("#combotree").combotree("tree").tree(‘isLeaf‘, node.target));
                if (!$("#combotree").combotree("tree").tree(‘isLeaf‘, node.target)) {
                    return false;
                }
            }

 

技术交流QQ群:15129679

以上是关于easyui combotree不让父级选中的主要内容,如果未能解决你的问题,请参考以下文章

表单(上)EasyUI Form 表单EasyUI Validatebox 验证框EasyUI Combobox 组合框EasyUI Combo 组合EasyUI Combotree 组合树((代码片

jquery easyui中 combotree的使用

easyui combotree获取选中的值

jQuery easyUI combotree清除选择

Jquery EasyUI Combotree根据选中的值展开所有父节点

easyUI combotree的问题,当我保存下拉框的值之后,修改时让已选择的select自动选中,求熟悉的高手指导