IgTree : Load on demand while expanding a node


I'd like to load all the childs elements only when i expand a particular node. What could be the proper way to do this ?

I'm guessing that i have to :

- Determine which nodes has some childs

- Create maybe a temp child node for those nodes in order to have the expansion icon.

- handle the onexpanding event, to perform an ajax call in order to retrieve the childs.

- remove the temp child node previously created and replace it with the real childs

Am i in the correct way of doing this, or there is another way ?

Thank you in advance