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

时间: 2024-08-01 22:38:53

easyui combotree不让父级选中的相关文章

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

Jquery EasyUI Combotree根据选中的值展开所有父节点  Jquery EasyUI Combotree 展开父节点, Jquery EasyUI Combotree根据子节点选中的值,展开前面所有父节点, Jquery EasyUI Combotree获取选中的值 ================================ ?Copyright 蕃薯耀 2018年5月7日 http://www.cnblogs.com/fanshuyao/ 一.Combotree获取父节

jstree高级使用,获取所有选中的值并且所有待选的父级结点值

var tree = $("#jstree").jstree({ "core": { "themes": { "responsive": false }, "check_callback": true, 'data': { 'url': function (node) { return '/test/jstreejson'; }, 'data': function (node) { return { 'pa

EasyUI Combotree只选择叶子节点

EasyUI Combotree的方法拓展自Combo和Tree.而Tree有一个onBeforSelect事件来帮助我们实现只选择叶子节点的功能. Tree事件需要 'node' 参数,它包括下列属性: id:绑定到节点的标识值. text:要显示的文本. iconCls:用来显示图标的 css class. checked:节点是否被选中. state:节点状态,'open' 或 'closed'. attributes:绑定到节点的自定义属性. target:目标的 DOM 对象. onB

less-符号之逗号,空格,父级选择器

Less符号 逗号 example: .test() { box-shadow+: inset 0 0 10px #555; } .study { .test(); box-shadow+: 0 0 20px black; } //output css .study { box-shadow: inset 0 0 10px #555, 0 0 20px black; } 属性后跟" + ",就是" , " 空格 example: .test() { transfor

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

EasyUI Form 表单 通过 $.fn.form.defaults 重写默认的 defaults. 表单(form)提供多种方法来执行带有表单字段的动作,比如 ajax 提交.加载.清除,等等.当提交表单时,调用 'validate' 方法来检查表单是否有效. 用法 创建一个简单的 HTML 表单.构建表单并给 id.action.method 赋值. <form id="ff" method="post"> <div> <lab

页面单击按钮弹出modaldialog然后调用ajax处理程序获取数据,给父级页面控件赋值

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RefTopicList.aspx.cs" Inherits="Project.RefTopicList" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.

jQuery使用(四):DOM操作之查找兄弟元素和父级元素

查找兄弟元素 向下查找兄弟元素 next() nextAll() nextUntil() 向上查找兄弟元素 prev() prevAll() prevUntil() 查找所有兄弟元素 siblings()  1.1.1.next()方法用来查找下一个兄弟元素,可以传参也可以不传参.参数可以是任意jQuery选择器,表示如果下一个元素如果是指定的元素就选定.当没有选中指定的元素时,jQuery链式调用还是保持原来的jQuery对象. <!-- next --> <button>点我&

el-tree点击获取直接父级的属性

这里是可以一直往上获取它的直接父级的所有属性以及状态 通过这两个事件其中的一个 在方法里可以写上 methods:{ curCheck(data,state){ const curNode = this.$refs.tree.getNode(data); } 这个getNode算是隐藏api了. 此处的curNode就是当前选中的节点的详细属性,其中有一个parent属性,,可以看到它的父级所有信息. } 欢迎进群学习交流(927465926) 原文地址:https://www.cnblogs.

jQuery父级以及同级元素查找的实例

父级以及同级元素的查找在使用过程中还是蛮频繁的,下面为大家介绍下jQuery是如何实现的,感兴趣的朋友可以参考下 jQuery.parent(expr) 找父亲节点,可以传入expr进行过滤,比如$("span").parent()或者$("span").parent(".class") jQuery.parents(expr),类似于jQuery.parents(expr),但是是查找所有祖先元素,不限于父元素 jQuery.children(