当前位置:网站首页>[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
边栏推荐
- Technology sharing | what if Undo is too big
- Deeply analyze the chain 2+1 mode, and subvert the traditional thinking of selling goods?
- A doctor's 22 years in Huawei
- Pat 1046 shortest distance (20 points) simulation
- 有没有sqlcdc监控多张表 再关联后 sink到另外一张表的案例啊?全部在 mysql中操作
- Blue Bridge Cup group B provincial preliminaries first question 2013 (Gauss Diary)
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
- 微服务注册与发现
- Is there a case where sqlcdc monitors multiple tables and then associates them to sink to another table? All operations in MySQL
- 【若依(ruoyi)】设置主题样式
猜你喜欢
Building the prototype of library functions -- refer to the manual of wildfire
CobaltStrike-4.4-K8修改版安装使用教程
High number_ Vector algebra_ Unit vector_ Angle between vector and coordinate axis
2345 file shredding, powerful file deletion tool, unbound pure extract version
PMP每日一练 | 考试不迷路-7.5
Communication between microservices
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
[Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation
A copy can also produce flowers
Qt发布exe软件及修改exe应用程序图标
随机推荐
深度解析链动2+1模式,颠覆传统卖货思维?
Dachang image library
After changing the GCC version, make[1] appears in the compilation: cc: command not found
Microservice registration and discovery
"Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.3 linear algebra_ Learning thinking and exercise answers
继承的构造函数
Follow the mouse's angle and keyboard events
有沒有sqlcdc監控多張錶 再關聯後 sink到另外一張錶的案例啊?全部在 mysql中操作
力扣今日题-729. 我的日程安排表 I
MySQL winter vacation self-study 2022 11 (8)
Atcoder beginer contest 233 (a~d) solution
解决:AttributeError: ‘str‘ object has no attribute ‘decode‘
Redis cluster deployment based on redis5
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
原型图设计
Misc (eternal night), the preliminary competition of the innovation practice competition of the National College Students' information security competition
主数据管理(MDM)的成熟度
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14
Communication between microservices
What should we pay attention to when using the built-in tool to check the health status in gbase 8C database?