当前位置:网站首页>[ruoyi] ztree custom icon (iconskin attribute)
[ruoyi] ztree custom icon (iconskin attribute)
2022-07-06 02:46:00 【sayyy】
Preface
- ruoyi 4.6.0
- JQuery zTree core 3.5.12
establish 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
: Style of branch node expansion status.ztree li span.button.ico2_ico_close
: The style of the folded state of the branch node.ztree li span.button.ico2_ico_docu
: The style of leaf nodes.ztree li span.button.<iconSkin name >_ico_open
:<iconSkin name >
CustomizableiconSkin ico2
:.ztree li span.button.ico2_ico_docu
The icon of is set to be the same as.ztree li span.button.ico2_ico_close
The icons of are consistent
Use iconSkin The way 1:
var setting = ...;
//js Middle node data :
var zTreeNodes = [
// The parent node expands Use the same icon when folding
{
name:" Parent node 1", iconSkin:"diy01"},
// The parent node expands Use different icons when folding
{
name:" Parent node 2", iconSkin:"diy02"},
// Personalized icon of leaf node
{
name:" Leaf node ", iconSkin:"diy03"}
];
//zTree initialization
$.fn.zTree.init($("#tree"), setting, zTreeNodes);
Use iconSkin The way 2:
var treeObj = $.fn.zTree.getZTreeObj("tree");
var treeNodes = treeObj.transformToArray(treeObj.getNodes());
treeNodes.forEach(treeNode => {
if (!treeNode.isParent) {
/* Set the leaf node's iconSkin Set to :ico2 */
treeNode.iconSkin = "ico2";
treeObj.updateNode(treeNode);
}
});
Reference resources
https://treejs.cn/v3/api.php
边栏推荐
- Which ecology is better, such as Mi family, graffiti, hilink, zhiting, etc? Analysis of five mainstream smart brands
- Redis skip table
- Force buckle 146 LRU cache
- Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
- Déduisez la question d'aujourd'hui - 729. Mon emploi du temps I
- [Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation
- PMP每日一练 | 考试不迷路-7.5
- ReferenceError: primordials is not defined错误解决
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
- Referenceerror: primordials is not defined error resolution
猜你喜欢
Misc (eternal night), the preliminary competition of the innovation practice competition of the National College Students' information security competition
【若依(ruoyi)】启用迷你导航栏
如何精准识别主数据?
故障分析 | MySQL 耗尽主机内存一例分析
一个复制也能玩出花来
Advanced technology management - what is the physical, mental and mental strength of managers
[matlab] access of variables and files
#PAT#day10
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 23
Pure QT version of Chinese chess: realize two-man, man-machine and network games
随机推荐
Sword finger offer 30 Stack containing min function
主数据管理(MDM)的成熟度
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
有没有完全自主的国产化数据库技术
GifCam v7.0 极简GIF动画录制工具中文单文件版
Taobao focus map layout practice
大厂镜像库
A doctor's 22 years in Huawei
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13
淘宝焦点图布局实战
微服务注册与发现
550 permission denied occurs when FTP uploads files, which is not a user permission problem
Classic interview question [gem pirate]
Briefly describe the implementation principle of redis cluster
微服务间通信
Redis delete policy
Httprunnermanager installation (III) - configuring myql Database & initialization data under Linux
C语言sizeof和strlen的区别
CSP numeric sort