当子节点使用JSTREE动态加载数据时,如何显示加载图像? [英] how to show loading image when a child node is loading data dynamically using JSTREE?

查看:94
本文介绍了当子节点使用JSTREE动态加载数据时,如何显示加载图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,iam通过ajax调用动态填充子节点数据.随着数据的增加,加载数据需要时间,因此我想在树中(子节点位置)显示加载图像.如何做到这一点?

In my project, iam populating the child nodes data dynamically through ajax call.As data is more, it is taking time to load the data.So i want to show a loading image in the tree(in child node position). how to achieve this?

推荐答案

在JSTREE中加载节点时,它将具有jstree-loading类.

When a node is loading in JSTREE, it will be having jstree-loading class.

因此,只需将以下内容添加到CSS:

Therefore, just add the following to your CSS:

.jstree-default a.jstree-loading .jstree-icon { 
    background:url(image name) center center no-repeat !important; 
} 

注意:

图像名称是一个变量.不要忘了用引号引起来.

Image name is a variable.Do not forget to keep in in quotations.

Ex代码:

.jstree-default a.jstree-loading .jstree-icon { 
    background:url("myImage.gif") center center no-repeat !important; 
} 

这篇关于当子节点使用JSTREE动态加载数据时,如何显示加载图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆