问题
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