Jquery EasyUI Combotree和 EasyUI tree展开所有父节点和获取完整路径
Jquery EasyUI Combotree展开所有父节点
Jquery EasyUI Combotree获取树完整路径
Jquery EasyUI tree展开所有父节点
Jquery EasyUI tree获取完整路径
================================
©Copyright 蕃薯耀 2018年5月11日
https://www.cnblogs.com/fanshuyao/
- /**
- * 根据叶子节点展开所有父节点
- * @param treeObj 树对象,(combotree的树对象获取:var treeObj = comboObj.combotree("tree");)
- * @param node 叶子节点
- */
- function expandParent(treeObj, node){
- var parentNode = treeObj.tree("getParent", node.target);
- if(parentNode != null && parentNode != "undefined"){
- treeObj.tree("expand", parentNode.target);
- expandParent(treeObj, parentNode);
- }
- };
- /**
- * tree初始化赋值并展开所有父节点
- * @param treeObj 树对象
- * @param leafValue 叶子节点的值
- */
- function treeInitValueAndExpand(treeObj, leafValue){
- var nodesChecked = treeObj.tree("getChecked");//获取选中的值
- if(nodesChecked.length > 0){
- for(var i=0; i<nodesChecked.length; i++){
- expandParent(treeObj, nodesChecked[i]);
- }
- }
- };
- /**
- * 根据叶子节点选中的值,获取树整个路径的名称
- * @param treeObj 树对象,(combotree的树对象获取:var treeObj = comboObj.combotree("tree");)
- * @param node 叶子节点
- */
- function getTreePathNames(treeObj, node){
- var pathName = node.text;
- var parentNode = treeObj.tree("getParent", node.target);
- if(parentNode != null && parentNode != "undefined"){
- pathName = getTreePathNames(treeObj, parentNode) + " > " + pathName;
- }
- return pathName;
- };
- /**
- * 根据叶子节点选中的值,获取树整个路径的名称
- * @param combotreeId 唯一ID
- * @param leafValue 叶子节点的值
- */
- function getCombotreePathNames(combotreeId, leafValue){
- var combotreeObj = $("#"+combotreeId);
- var treeObj = combotreeObj.combotree("tree");
- var nodesChecked = treeObj.tree("getChecked");//获取选中的值
- var pathName = "";
- if(nodesChecked.length > 0){
- for(var i=0; i<nodesChecked.length; i++){
- pathName += getTreePathNames(treeObj, nodesChecked[i]);
- }
- }
- return pathName;
- };
- /**
- * combotree初始化赋值并展开所有父节点
- * @param combotreeId 唯一ID
- * @param leafValue 叶子节点的值
- */
- function combotreeInitValueAndExpand(combotreeId, leafValue){
- var combotreeObj = $("#"+combotreeId);
- var treeObj = combotreeObj.combotree("tree");
- combotreeObj.combotree("setValue", leafValue);//赋值
- treeInitValueAndExpand(treeObj, leafValue);
- };
================================
©Copyright 蕃薯耀 2018年5月11日
https://www.cnblogs.com/fanshuyao/
Jquery EasyUI Combotree和 EasyUI tree展开所有父节点和获取完整路径的更多相关文章
- Jquery EasyUI Combotree根据选中的值展开所有父节点
Jquery EasyUI Combotree根据选中的值展开所有父节点 Jquery EasyUI Combotree 展开父节点, Jquery EasyUI Combotree根据子节点选中的 ...
- EasyUI的tree展开所有的节点或者根据特殊的条件控制展示指定的节点
展示tree下的所有节点$(function(){ $('#t_funinfo_tree').tree({ checkbox: true, url:"<%=basePath %> ...
- jQuery中兄弟元素、子元素和父元素的获取
我们这里主要总结jQuery中对某元素的兄弟元素.子元素和父元素的获取,原声的Javascript代码对这些元素的获取比较麻烦一些,而jQuery正好对这些方法进行封装,让我们更加方便的对这些元素进行 ...
- jQuery之导航菜单(点击该父节点时子节点显示,同时子节点的同级隐藏,但是同级的父节点始终显示)
注:对于同一个对象不超过3个操作的,可直接写成一行,超 过3个操作的建议每行写一个操作.这样可读性较强,可提高代码的可读性和可维护性 核心代码: $(".has_children" ...
- Jquery EasyUI Combotree 初始化赋值
Jquery EasyUI Combotree 初始化赋值 ================================ ©Copyright 蕃薯耀 2018年5月7日 https://www. ...
- Jquery EasyUI Combotree只能选择叶子节点且叶子节点有多选框
Jquery EasyUI Combotree只能选择叶子节点且叶子节点有多选框 Jquery EasyUI Combotree单选框,Jquery EasyUI Combotree只能选择叶子节点 ...
- easyui.combotree.search.js
(function ($) { //combotree可编辑,自定义模糊查询 $.fn.combotree.defaults.editable = true; $.extend($.fn.combot ...
- EasyUI ComboTree无限层级异步加载示例
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EasuUIDemoTree.a ...
- easyui Combotree 怎么加载数据 支持多选
1.开发环境vs2012 mvc4 c# 2.HTML前端代码 <%@ Page Language="C#" AutoEventWireup="true" ...
随机推荐
- angular清除select空格
<select class="form-control" id="policy_set_id" ng-model="add.poli ...
- sencha touch 选择器
1 DOM元素选择器 Ext.DomQuery操作标准DOM元素 Ext.query(selector, [root]) : HTMLElement[] // 调用Ext.dom.Query.sele ...
- 转 js Infinite Scrolling Demo
原文:http://www.sitepoint.com/jquery-infinite-scrolling-demos/ Infinite Scrolling Demo 5 Usage – HTML ...
- 【并查集】Connectivity @ABC049&ARC065/upcexam6492
Connectivity 时间限制: 1 Sec 内存限制: 128 MB 题目描述 There are N cities. There are also K roads and L railway ...
- sort函数比较cmp写法
hihocoder1566http://hihocoder.com/problemset/problem/1566 一直WA因为cmp的写法写错了,未能正确实现排序功能. #include<io ...
- seq_file学习(1)—— single_open
span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }.CodeMirror ...
- 咏南DELPHI7中间件+开发框架
咏南DELPHI7中间件+开发框架 演示下载:链接: https://pan.baidu.com/s/1bulGBIZ6A1nkeErxIrGsGA 密码: 22dk 解压后运行ynmain.exe ...
- java后台服务器启动脚本
最近由于经常在项目上线或者调试中启动服务,由于要设置环境变量这些,所以为了方便写了个启动脚本,希望能够帮助大家,也算是给自己做个小笔记: example_project_start.sh: # /bi ...
- ValueError: output parameter for reduction operation logical_and has too many dimensions ?
https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.all.html#numpy.all 运行示例,却发生错误 import ...
- 阿里云服务器CentOS7 vsftp安装、设置及后台端口的设置
查看是否安装vsftp,我这个是已经安装的. [root@localhost vsftpd]# rpm -qa |grep vsftpd vsftpd-3.0.2-11.el7_2.x86_64 如果 ...