惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
A
About on SuperTechFans
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Blog — PlanetScale
Blog — PlanetScale
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
G
Google Developers Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
MyScale Blog
MyScale Blog
H
Heimdal Security Blog
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
Latest news
Latest news
I
Intezer
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
月光博客
月光博客
T
Threatpost
博客园 - 【当耐特】
S
Schneier on Security
P
Privacy International News Feed
G
GRAHAM CLULEY
T
Tenable Blog
AWS News Blog
AWS News Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
博客园 - Franky
Engineering at Meta
Engineering at Meta
美团技术团队
S
Secure Thoughts
T
Troy Hunt's Blog
Microsoft Security Blog
Microsoft Security Blog
SecWiki News
SecWiki News
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Cisco Talos Blog
Cisco Talos Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Martin Fowler
Martin Fowler
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 飞花雪月

ASP.NET Core-wwwroot文件夹 ASP.NET MVC4中的bundles特性引发服务器拒绝访问(403错误) 两步验证Authy时间同步问题 您的项目引用了最新实体框架;但是,找不到数据链接所需的与版本兼容的实体框架数据库 EF6使用Mysql的技巧 教你如何调用百度编辑器ueditor的上传图片、上传文件等模块 HTML5添加 video 视频标签后仍然无法播放的解决方法 IIS添加MIEI类型 ASP.NET性能优化之减少请求 ASP.NET中获取当日,当周,当月,当年的日期 Convert.ToInt32()与int.Parse()的区别 C#/JS 获取二维数组组合 【转】浅析Sql Server参数化查询 【转】Sql Server参数化查询之where in和like实现之xml和DataTable传参 【转】Sql Server参数化查询之where in和like实现详解 推薦使用 Microsoft Anti-Cross Site Scripting Library V3.0 推薦使用 Microsoft Anti-Cross Site Scripting Library v3.1 IIS中ASP.NET安全配置 好用的SQLSERVER数据库自动备份工具SQLBackupAndFTP(功能全面) iframe在ipad safari的显示 从WEB SERVICE 上返回大数据量的DATASET
Easyui Tree方法扩展 - getLevel(获取节点级别)
飞花雪月 · 2015-06-30 · via 博客园 - 飞花雪月

Easyui Tree一直就没有提供这个方法,以前没有用到,所以一直没怎么在意,这次自己用到了,顺便扩展了一个方法,分享给大家.

$.extend($.fn.tree.methods, {
	getLevel:function(jq,target){
		var l = $(target).parentsUntil("ul.tree","ul");
		return l.length+1;
	}
});

 用法:

var node = $().tree("getSelected");
var lv =  $().tree("getLevel",node.target);
 $('#ParentID').combotree({
                //获取数据URL  
                url: '/Handlers/Car_BrandHandler.ashx?type=tree',
                //选择树节点触发事件  
                onSelect: function (node) {
                    
                    var node11 = $(this).tree("getSelected");
                   
                    alert($(this).tree("getLevel", node11.target));

                }
            });