Show loadimage while loadXML and kidsXmlFile

I would like to display a small loading image when the loadXML and kisXmlFile are called.



So when I click on a node in a dhtmlxGrid it retrieves data from the server, during this time the image is displayed and when it finished fetching all information the image is hidden again.



The same goes for the loadXML function so when I open the page the loading image is displayed and when it finishes retrieving the information the image is hidden again.

You can use “onOpenStart” and “onOpenEnd” events. onOpenStart event occurs when opening initiated, but not started yet. (in case of dyn. loading - before xml loading)

This event passes the following parameters:
id - id of the node that will be opened/closed;
state - current open state of tree item; -1 means that the item is closed, 1 - item is opened.
grid.attachEvent(“onOpenStart”, function(id,state){});

This event returns: true - confirms opening/closing; false - denies opening/closing.

onOpenEnd event occurs when branch opened (in case of dyn. loading - after xml loading). This event passes the following parameters:
id - id of the node that will be opened/closed;
state - current open state of tree item; -1 means that the item is closed, 1 - item is opened.
grid.attachEvent(“onOpenEnd”, function(id,state){});