jQuery EasyUI CheckBoxTree的级联选中
来源:互联网 发布:党员队伍结构持续优化 编辑:程序博客网 时间:2024/06/14 07:40
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <link href="js/themes/default/easyui.css" rel="stylesheet" /> <link href="js/themes/icon.css" rel="stylesheet" /> <script src="js/jquery-1.8.0.min.js"></script> <script src="js/jquery.easyui.min.js"></script> <script src="js/locale/easyui-lang-zh_CN.js"></script> <script type="text/javascript"> var data = [{ "id": 1, "text": "系统", "children": [{ "id": 11, "text": "用户管理", "children": [{ "id": 19, "text": "增加" }, { "id": 3, "text": "修改" }, { "id": 5, "text": "删除" }] }, { "id": 12, "text": "角色管理", "children": [{ "id": 13, "text": "增加" }, { "id": 3, "text": "修改" }, { "id": 5, "text": "删除" }] }] }, { "id": 2, "text": "其他", "state": "closed" }]; $(function () { $("#tt").tree({ data: data, checkbox: true, cascadeCheck: false, onCheck: function (node, checked) { if (checked) { var parentNode = $("#tt").tree('getParent', node.target); if (parentNode != null) { $("#tt").tree('check', parentNode.target); } } else { var childNode = $("#tt").tree('getChildren', node.target); if (childNode.length > 0) { for (var i = 0; i < childNode.length; i++) { $("#tt").tree('uncheck', childNode[i].target); } } } } }); }); function getChecked() { var arr = []; var checkeds = $('#tt').tree('getChecked', 'checked'); for (var i = 0; i < checkeds.length; i++) { arr.push(checkeds[i].id); } alert(arr.join(',')); } </script></head><body> <ul id="tt"></ul> <input type="button" value="获取选中" onclick="getChecked()" /></body></html>
如图:
转载:http://www.cnblogs.com/xiaowangzhi/p/3326748.html
0 0
- jQuery EasyUI CheckBoxTree的级联选中
- jQuery EasyUI CheckBoxTree的级联选中
- jquery easyui树形级联选中
- easyUi Tree的CheckBox级联选中问题
- jquery easyui的treegrid的级联扩展
- jquery实现的简单复选树,checkboxtree
- 【jQuery easyUI】jQuery 获取easyUI combobox选中的值
- 关于checkboxtree选中的一个小例子非常使用
- jquery 获取easyui combobox选中的值
- jQuery easyui 选中特定的tab
- jquery 获取easyui combobox选中的值
- jquery easyui 实现级联效果
- 实现jquery Easyui中combotree,combobox控件的动态选中
- jquery easyui tree reload以后选中之前选择的节点
- 基于Jquery easyui 选中特定的tab并更新
- CheckBoxTree
- CheckBoxTree
- CheckBoxTree
- leetcode 日经贴,Cpp code -Factorial Trailing Zeroes
- 2015腾讯面试总结
- 在rational rose类图的工具栏中没有表示聚合和组合关系的工具
- CososJS学习笔记(1) 环境配置(填坑版,让你少走弯路!)
- 锚的效果的实现
- jQuery EasyUI CheckBoxTree的级联选中
- C# - 扩展函数
- C++ COM编程之什么是接口
- MYSQL安装过程中,卡在Attemptting to start serverce解决方案
- Tracking using Multilevel Quantizations MQT算法学习
- C++笔记(1)explicit构造函数
- Android Fragment 基本介绍
- scp远程文件传输
- Ubuntu 使用 virtualbox 安装win7 实现文件共享