EasyUI Combotree 只容許選擇 葉子節點

 $("#SDID").combotree({
            url: '/Ajax/GetDeptTree.aspx?level=4&pid=-1',

            onSelect: function (node) {
                //if (record.attributes.nodetype != 4) {
                //    return false;
                //}
                //返回樹對象  
                var tree = $(this).tree;
                //選中的節點是否爲葉子節點,若是不是葉子節點,清除選中  
                var isLeaf = tree('isLeaf', node.target);
                if (!isLeaf) {
                    //清除選中  
                    $('#SDID').combotree('clear');
                }
            },
            onLoadSuccess: function (node, data) {
            }
        });
相關文章
相關標籤/搜索