当前位置:网站首页>[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
边栏推荐
- PMP每日一练 | 考试不迷路-7.5
- 主数据管理理论与实践
- Taobao focus map layout practice
- Six stone management: why should leaders ignore product quality
- 【MySQL 15】Could not increase number of max_ open_ files to more than 10000 (request: 65535)
- Redis delete policy
- 【若依(ruoyi)】启用迷你导航栏
- Microsoft speech synthesis assistant v1.3 text to speech tool, real speech AI generator
- 【若依(ruoyi)】设置主题样式
- 原型图设计
猜你喜欢
2345文件粉碎,文件强力删除工具无捆绑纯净提取版
High number_ Vector algebra_ Unit vector_ Angle between vector and coordinate axis
【Unity3D】GUI控件
解决:AttributeError: ‘str‘ object has no attribute ‘decode‘
Pure QT version of Chinese chess: realize two-man, man-machine and network games
Misc (eternal night), the preliminary competition of the innovation practice competition of the National College Students' information security competition
2022.02.13
Déduisez la question d'aujourd'hui - 729. Mon emploi du temps I
Sword finger offer 29 Print matrix clockwise
GifCam v7.0 极简GIF动画录制工具中文单文件版
随机推荐
Shell script updates stored procedure to database
I changed the driver to 5.1.35, but it is still the same error. I can succeed even now, but I will report this every time I do an SQL operation
Force buckle 146 LRU cache
Technology sharing | what if Undo is too big
Elimination games
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
How to check the lock information in gbase 8C database?
CobaltStrike-4.4-K8修改版安装使用教程
Pat 1084 broken keyboard (20 points) string find
【若依(ruoyi)】设置主题样式
Blue Bridge Cup group B provincial preliminaries first question 2013 (Gauss Diary)
Zero foundation self-study STM32 - Review 2 - encapsulating GPIO registers with structures
RobotFramework入门(二)appUI自动化之app启动
微服务间通信
Redis installation
张丽俊:穿透不确定性要靠四个“不变”
Installation and use tutorial of cobaltstrike-4.4-k8 modified version
[network security interview question] - how to penetrate the test file directory through
Follow the mouse's angle and keyboard events
2.13 simulation summary