当前位置:网站首页>【若依(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
边栏推荐
- 2345 file shredding, powerful file deletion tool, unbound pure extract version
- PAT甲级 1033 To Fill or Not to Fill
- Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
- 更换gcc版本后,编译出现make[1]: cc: Command not found
- Y a - t - il des cas où sqlcdc surveille plusieurs tables et les associe à une autre? Tout fonctionne dans MySQL
- Accident index statistics
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 15
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
- Building the prototype of library functions -- refer to the manual of wildfire
- Li Kou today's question -729 My schedule I
猜你喜欢
Deeply analyze the chain 2+1 mode, and subvert the traditional thinking of selling goods?
CobaltStrike-4.4-K8修改版安装使用教程
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
The third level of C language punch in
Introduction to robotframework (II) app startup of appui automation
RobotFramework入门(二)appUI自动化之app启动
Universal crud interface
PAT甲级 1033 To Fill or Not to Fill
ReferenceError: primordials is not defined错误解决
Redis delete policy
随机推荐
在GBase 8c数据库中使用自带工具检查健康状态时,需要注意什么?
Redis cluster deployment based on redis5
Large scale DDoS attacks take Myanmar offline
How to improve the enthusiasm of consumers when the member points marketing system is operated?
2.13 simulation summary
HttpRunnerManager安装(三)-Linux下配置myql数据库&初始化数据
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
Zero foundation self-study STM32 - Review 2 - encapsulating GPIO registers with structures
Advanced technology management - what is the physical, mental and mental strength of managers
有沒有sqlcdc監控多張錶 再關聯後 sink到另外一張錶的案例啊?全部在 mysql中操作
力扣今日題-729. 我的日程安排錶 I
[Wu Enda machine learning] week5 programming assignment EX4 - neural network learning
Black high-end responsive website dream weaving template (adaptive mobile terminal)
Sword finger offer 30 Stack containing min function
[matlab] access of variables and files
Atcoder beginer contest 233 (a~d) solution
[untitled] a query SQL execution process in the database
数据准备工作
Trends in DDoS Attacks
如何精准识别主数据?