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" ...
随机推荐
- ssm数据库异常问题
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Reflecti ...
- 3ds max学习笔记(八)-- 实例操作(直行楼梯)
1.选择要复制的物体,执行[工具]/[阵列]命令,弹出对话框: 2.参数说明: 应用: 1.[自定义]/[单位设置],将单位改为mm 在顶视图中,创建长方体,长1600,宽300,高度150 2.在前 ...
- pygame-KidsCanCode系列jumpy-part7-游戏启动/结束画面
通常一个游戏启动(start)或结束(game over)时,都会显示一个画面,来引导用户.这节,我们学习如何处理这块逻辑. 其实之前,我们已经预留了2个函数,只要把它实现即可: def show_s ...
- Unity插件扩展中组件常用的几个方法
最近为美术编写一个Unity编辑器的扩展,主要为了减轻美术在修改预制对象时的机械化操作的繁琐和出错.具体实现的几个功能: 1.删除指定组件: 2.复制.粘贴指定的组件: 3.重新关联新的属性: 4.重 ...
- Siamese网络
1. 对比损失函数(Contrastive Loss function) 孪生架构的目的不是对输入图像进行分类,而是区分它们.因此,分类损失函数(如交叉熵)不是最合适的选择,这种架构更适合 ...
- FPGA基础之逻辑单元(LE or LC)的基本结构
原帖地址: https://blog.csdn.net/a8039974/article/details/51706906/ 逻辑单元在FPGA器件内部,是完成用户逻辑的最小单元.逻辑单元在ALTER ...
- 创建MySQL用户 赋予某指定库表的权限
摘自: http://renxiangzyq.iteye.com/blog/763837 update ERROR 1364 (HY000): Field 'ssl_cipher' doesn't h ...
- AsyncHttpSupport并发发送请求
public class AsyncHttpSupportTest { @InjectMocks private AsyncHttpSupport asyncHttpSupport; @Mock pr ...
- WPF双向数据绑定总结
参考官方:https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/data/data-binding-wpf 实例程序:https://files. ...
- Python随机字符串验证码
def code_get(self): source = ['] #数字验证码 # source = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H','I','J', ...