Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Chris on Aug 28, 2009 00:34
open dhtmlx forum
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.
Answer posted by dhxSupport on Aug 28, 2009 02:11
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){});