how to show loading image when a child node is loading data dynamically using JSTREE?

岁酱吖の 提交于 2019-12-12 14:02:12

问题


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?


回答1:


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

Therefore, just add the following to your CSS:

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

Note:

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

Ex code:

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


来源:https://stackoverflow.com/questions/19491806/how-to-show-loading-image-when-a-child-node-is-loading-data-dynamically-using-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!