当前位置:网站首页>【若依(ruoyi)】ztree 自定义图标(iconSkin 属性)
【若依(ruoyi)】ztree 自定义图标(iconSkin 属性)
2022-07-06 02:41:00 【sayyy】
前言
- ruoyi 4.6.0
- JQuery zTree core 3.5.12
创建 iconSkin
.ztree li span.button.ico2_ico_open{
margin-right:2px; background-position: -147px -21px; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico2_ico_close{
margin-right:2px; margin-right:2px; background-position: -147px 0; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico2_ico_docu{
margin-right:2px; background-position: -147px 0; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico2_ico_open:支节点展开状态的样式.ztree li span.button.ico2_ico_close:支节点折叠状态的样式.ztree li span.button.ico2_ico_docu:叶子节点的样式.ztree li span.button.<iconSkin 名称>_ico_open:<iconSkin 名称>可自定义iconSkin ico2:.ztree li span.button.ico2_ico_docu的图标设置成与.ztree li span.button.ico2_ico_close的图标一致
使用iconSkin方式1:
var setting = ...;
//js中节点数据:
var zTreeNodes = [
//父节点展开 折叠时使用相同的图标
{
name:"父节点1", iconSkin:"diy01"},
//父节点展开 折叠时分别使用不同的图标
{
name:"父节点2", iconSkin:"diy02"},
//叶子节点个性化图标
{
name:"叶子节点", iconSkin:"diy03"}
];
//zTree 初始化
$.fn.zTree.init($("#tree"), setting, zTreeNodes);
使用iconSkin方式2:
var treeObj = $.fn.zTree.getZTreeObj("tree");
var treeNodes = treeObj.transformToArray(treeObj.getNodes());
treeNodes.forEach(treeNode => {
if (!treeNode.isParent) {
/* 将叶子节点的iconSkin设置为:ico2 */
treeNode.iconSkin = "ico2";
treeObj.updateNode(treeNode);
}
});
参考
https://treejs.cn/v3/api.php
边栏推荐
- Thinking on Architecture Design (under continuous updating)
- Is there a case where sqlcdc monitors multiple tables and then associates them to sink to another table? All operations in MySQL
- "Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.3 linear algebra_ Learning thinking and exercise answers
- 模板_求排列逆序对_基于归并排序
- DDoS attacks - are we really at war?
- DDoS "fire drill" service urges companies to be prepared
- SSM assembly
- 球面透镜与柱面透镜
- Trends in DDoS Attacks
- 模板_快速排序_双指针
猜你喜欢

High number_ Vector algebra_ Unit vector_ Angle between vector and coordinate axis
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19](/img/7c/f728e88ca36524f92c56213370399b.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19

MySQL winter vacation self-study 2022 11 (9)

Shell script updates stored procedure to database

Yyds dry inventory comparison of several database storage engines

纯Qt版中国象棋:实现双人对战、人机对战及网络对战

Deeply analyze the chain 2+1 mode, and subvert the traditional thinking of selling goods?
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14](/img/c5/dde92f887e8e73d7db869fcddc107f.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14

Blue Bridge Cup group B provincial preliminaries first question 2013 (Gauss Diary)

Which ecology is better, such as Mi family, graffiti, hilink, zhiting, etc? Analysis of five mainstream smart brands
随机推荐
更换gcc版本后,编译出现make[1]: cc: Command not found
PMP每日一练 | 考试不迷路-7.5
HttpRunnerManager安装(三)-Linux下配置myql数据库&初始化数据
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
SSM assembly
3D drawing ()
How to improve the enthusiasm of consumers when the member points marketing system is operated?
Data preparation
有沒有sqlcdc監控多張錶 再關聯後 sink到另外一張錶的案例啊?全部在 mysql中操作
Zero basic self-study STM32 wildfire review of GPIO use absolute address to operate GPIO
淘宝焦点图布局实战
Déduisez la question d'aujourd'hui - 729. Mon emploi du temps I
纯Qt版中国象棋:实现双人对战、人机对战及网络对战
Number conclusion LC skimming review - 1
故障分析 | MySQL 耗尽主机内存一例分析
Six stone management: why should leaders ignore product quality
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
Zero foundation self-study STM32 - Review 2 - encapsulating GPIO registers with structures
[postgraduate entrance examination English] prepare for 2023, learn list5 words
07 singleton mode