修改EsayUi 中 tree 的原有样式,变为according 之类的样式 ,且子菜单显示在右侧...

本文介绍如何在easyUI框架中自定义树形组件(tree)的展开样式,通过JavaScript代码实现对节点展开时的样式调整,包括位置、尺寸及滚动条等特性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

easyUi 中 tree 框架的属性有:

 

 

修改原有展开样式代码如下:

 1 onExpand:function(node,param){
 2             $(this).children("li").each(function(){
 3                 if($(this).children("ul").length>0){
 4                     $(this).children("ul").hide();
 5                     $(this).children("div.tree-node").find(".tree-hit").addClass("tree-collapsed").removeClass("tree-expanded");
 6                     $(this).children("div.tree-node").find(".tree-icon").removeClass("tree-folder-open");
 7                     if($(this).children("div.tree-node").find(".tree-title").text()==node.text){
 8                         $(this).children("ul").show();
 9                         $(this).children("ul").css({'position':'absolute','top':'20px','left':'60px','width':'300px','height':'650px','overflow-y':'auto'})
10                         $(this).children("div.tree-node").find(".tree-hit").addClass("tree-expanded").removeClass("tree-collapsed");
11                         $(this).children("div.tree-node").find(".tree-icon").addClass("tree-folder-open");
12                     }
13                 }
14             });
15 }

 

转载于:https://www.cnblogs.com/vali/p/5884783.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值